This table example demonstrates the use of the colspan, rowspan, and bgcolor attributes of the TD and TH elements. I use the entity in the empty TD cells. I use named colors to set the bgcolor attributes. | ||||||||||||||||||||||||||||||
Put this in the BODY of your HTML file: | Displayed in a Web browser, it will look something like this: | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<TABLE border="1">
<TR><TH rowspan="2" bgcolor="silver">Tasks</TH> <TH colspan="7" bgcolor="aqua">Days of the Week</TH></TR> <TR> <TH>Mon</TH> <TH>Tue</TH> <TH>Wed</TH> <TH>Thu</TH> <TH>Fri</TH> <TH>Sat</TH> <TH>Sun</TH> </TR> <TR> <TH>School</TH> <TD> </TD> <TD>CS290</TD> <TD> </TD> <TD>CS290</TD> <TD> </TD> <TD colspan="2" rowspan="2" bgcolor="lime">Off</TD> </TR> <TR> <TH>Work</TH> <TD colspan="2">december.com</TD> <TD bgcolor="yellow" colspan="3">Weekend Prep</TD> </TR> </TABLE> |
|