hi this is my code,
$tbl .=
<tr><td width="5%">' . $reqid . '</td>
<td>' . $name . '</td>
<td width="12%">' . $date . '</td>
<td>' . $start . '</td>
<td>' . $end . '</td>
<td>' . $veh_name . '</td>
<td>' . $reason . '</td>
<td>' . $status . '</td>
<td>' . $sup . '</td>
<td width="15%">' . $comment . '</td>
</tr>';
}
How can i add a table header? for every column. i tried to put a header but the header repeats itself at every row of data.
You can add another <tr></tr>
above the data,and give your for loop
after this header.
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
</tr>
Place this html before the loop. Also remember that for better practice, you can declare your width in the header.
<tr>
<th width="5%">Req ID</th>
<th>Name</th>
<th width="12%">Date</th>
<th>Start</th>
<th>End</th>
<th>Veh Name</th>
<th>Reason</th>
<th>Status</th>
<th>Sup</th>
<th width="15%">Comment</th>
</tr>
you are missing '
from starting.
$tbl .=
'<tr><td width="5%">' . $reqid . '</td>
<td>' . $name . '</td>
<td width="12%">' . $date . '</td>
<td>' . $start . '</td>
<td>' . $end . '</td>
<td>' . $veh_name . '</td>
<td>' . $reason . '</td>
<td>' . $status . '</td>
<td>' . $sup . '</td>
<td width="15%">' . $comment . '</td>
</tr>';