I'm trying to generate a table that displays a schedule. It calls two other functions (get_timeslot() & get_timetable()) These are working fine as it is displaying the correct data, just not inside the table. The table displays below it, only empty.
here is the code
function show_timetable() {
$returnStr = "<table width='90%' border='2' cellspacing='3' cellpadding='3'>
<tr>
<td width='24%'>Times</td>\n
<td width='11%'>Mon</td>\n
<td width='11%'>Tue</td>\n
<td width='11%'>Wed</td>\n
<td width='11%'>Thu</td>\n
<td width='11%'>Fri</td>\n
<td width='11%'>Sat</td>\n
</tr>";
for ($timeslot = 1; $timeslot < 10; $timeslot++) {
$returnStr .= '<tr>' . '<td>' . get_timeslot($timeslot) . '</td>';
for ($day = 1; $day < 7 ; $day++) {
$returnStr .= '<td>' . get_timetable($day, $timeslot) . '</td>';
}
$returnStr .= '</tr>' ;
}
$returnStr .= '</table>';
echo $returnStr;
}
here is the code
function show_timetable() {
$returnStr = "<table width='90%' border='2' cellspacing='3' cellpadding='3'>
<tr>
<td width='24%'>Times</td>\n
<td width='11%'>Mon</td>\n
<td width='11%'>Tue</td>\n
<td width='11%'>Wed</td>\n
<td width='11%'>Thu</td>\n
<td width='11%'>Fri</td>\n
<td width='11%'>Sat</td>\n
</tr>";
for ($timeslot = 1; $timeslot < 10; $timeslot++) {
$returnStr .= '<tr>' . '<td>' . get_timeslot($timeslot) . '</td>';
for ($day = 1; $day < 7 ; $day++) {
$returnStr .= '<td>' . get_timetable($day, $timeslot) . '</td>';
}
$returnStr .= '</tr>' ;
}
$returnStr .= '</table>';
echo $returnStr;
}