Without using echo, how do I get the $report array of records to populate this html table?
The first row $report[0] shows up fine but I'm not sure how to get it loop through the table and automatically display the other rows.
$report = get_field('maths_month_report');
$report1 = $report[0];
$report2 = implode('</td><td>', $report1);
if (in_array('Maths', $subjecttitle)) {
return '
<table width="100%" id="report">
<tr>
<th width="10%">Month</th>
<th width="10%">Progress</th>
<th width="10%">Well-being</th>
<th width="35%">Remarks</th>
<th width="35%">Target</th>
</tr>
<tr>
<td>'. $report2 .'</td>
</tr>
</table>
';
}
foreach( $report as $re ){ // $report1, $report2, in_array etc codes // $html .= 'Your table code'; }