我有一张桌子,上面有每天的信息:
idDya | date | startHour | endHour | totalHours | name
-------------------------------------------------------
1 05/01 12:00 16:00 4 John
2 05/01 12:00 16:00 4 Marko
3 05/02 12:00 17:00 3 John
4 05/02 12:00 17:00 3 Peter
5 05/03 12:50 18:00 5 Peter
我有一个动态表:
<?php
$sql = " SELECT * FROM days ";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo "<table width='435' border='1' cborder='1' cellpadding='2' cellspacing='0' bordercolor='#666666' class='boldtable'>
<tr>
<td>".$row['idDya']."</td>
<td>".$row['date ']."</td>
<td>".$row['totalHours']."</td>
<td>".$row['name']."</td>
</tr>
</table>";
}
?>
问题:“我如何格式化表格,所以我有一个动态表格,但每个单元格都适合组合该日期的信息”。
day schedule
--------------------------------
05/01 | John 12:00 -16:00
Marko 12:00 -16:00
--------------------------------
05/02 | John 12:00 -16:00
Peter 12:00 -16:00
--------------------------------
etc...