I am making a calendar using the following HTML code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head></head>
<body>
<table border="1">
<tr>
<td colspan="2">Mon</td>
<td colspan="2">Tue</td>
<td colspan="2">Wed</td>
<td colspan="2">Thu</td>
<td colspan="2">Fri</td>
</tr>
<tr>
<td colspan="1">Item1</td>
<td colspan="9">Item2</td>
</tr>
</table>
</body>
Each day has a colspan of 2 so that I can show whether an item takes place just in the morning or for a whole day etc.
In the above example I want “Item1” to show in the first cell (Mon morning) and “Item2” to show from Mon afternoon through to Fri.
However, when viewing the output, “Item1” is taking up the whole of Mon and “Item2” is displaying from Tue to Fri.
Is it possible to do what I am trying to do?
Thanks
I think the problem is that you’ll actually have to have a row with
colspan="1"in order for your spans to actually work.If you’re actually representing am/pm in your calendar, why not just add a row under the “Mon Tue … Fri” row, like so:
I also put the headers into a
<thead>and the actual items into a<tbody>, and made the headers<th>tags instead of<td>.