HTML Table Colspan -
HTML Table Colspan -
i making calendar using next 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 colspan of 2 can show whether item takes place in morning or whole day etc.
in above illustration want "item1" show in first cell (mon morning) , "item2" show mon afternoon through fri.
however, when viewing output, "item1" taking whole of mon , "item2" displaying tue fri.
is possible trying do?
thanks
i think problem you'll have have row colspan="1"
in order spans work.
if you're representing am/pm in calendar, why not add together row under "mon tue ... fri" row, so:
<!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <style> td,th { min-width: 50px; } </style> </head> <body> <table border="1"> <thead> <tr> <th colspan="2">mon</th> <th colspan="2">tue</th> <th colspan="2">wed</th> <th colspan="2">thu</th> <th colspan="2">fri</th> </tr> <tr> <th>am</th> <th>pm</th> <th>am</th> <th>pm</th> <th>am</th> <th>pm</th> <th>am</th> <th>pm</th> <th>am</th> <th>pm</th> </tr> </thead> <tbody> <tr> <td colspan="1">item1</td> <td colspan="9">item2</td> </tr> </tbody> </table> </body> </html>
i set headers <thead>
, actual items <tbody>
, , made headers <th>
tags instead of <td>
.
html html-table
Comments
Post a Comment