DESCRIPTION OUTPUT SOURCE CODE |
Table cells can span across more than one column or row. The attributes COLSPAN ("how many across") and ROWSPAN ("how many down") indicate how many columns or rows a cell should take up.
Each row or column in a table must have the same number of cells defined. Cells that span across or columns count for as many cells as the value of their ROWSPAN or COLSPAN attribute.
Cell 1 | Cell 2 | Cell 3 | Cell 4 |
Cell 5 | Cell 6 | Cell 7 | Cell 8 |
Cell 9 | Cell 10 | Cell 11 | Cell 12 |
Cell 1 | Cell 2 | Cell 3 | Cell 4 | ||
Cell 5 | Cell 6 | Cell 7 | Cell 8 | ||
Cell 9 | Cell 10 | Cell 11 | Cell 12 |
Cell 1 | Cell 2 | Cell 3 | Cell 4 | ||
Cell 5 | Cell 6 | Cell 7 | Cell 8 | ||
Cell 9 | Cell 10 | Cell 11 | Cell 12 |
<HTML> <HEAD> <TITLE>A Web page with variable-size table cells</TITLE></HEAD> <BODY> <FONT COLOR = red><CENTER>This table uses equal cells</center></FONT> <TABLE ALIGN =center BORDER = 4> <TR> <TD>Cell 1</TD><TD>Cell 2</TD><TD>Cell 3</TD><TD>Cell 4</TD> </TR> <TR> <TD>Cell 5</TD><TD>Cell 6</TD><TD>Cell 7</TD><TD>Cell 8</TD> </TR> <TR> <TD>Cell 9</TD><TD>Cell 10</TD><TD>Cell 11</TD><TD>Cell 12</TD> </TR> </TABLE> <P> <FONT COLOR = red><<CENTER>This table uses cell 5 that spans two rows and three columns</CENTER></FONT> <TABLE ALIGN =center BORDER = 4> <TR> <TD>Cell 1</TD><TD>Cell 2</TD><TD>Cell 3</TD><TD>Cell 4</TD> </TR> <TR> <TD ROWSPAN = 2 COLSPAN = 3 ALIGN = center>Cell 5</TD> <TD>Cell 6</TD><TD>Cell 7</TD><TD>Cell 8</TD> </TR> <TR> <TD>Cell 9</TD><TD>Cell 10</TD><TD>Cell 11</TD><TD>Cell 12</TD> </TR> </TABLE> <P> <FONT COLOR = red><CENTER>This table uses cell 5 that spans two rows and three columns. The table also has a width of 200 pixels, a height of 100 pixels, and cell spacing of 8 pixels</CENTER></FONT> <TABLE ALIGN =center BORDER = 4 WIDTH = 200 HEIGHT = 100 CELLSPACING = 8> <TR> <TD>Cell 1</TD><TD>Cell 2</TD><TD>Cell 3</TD><TD>Cell 4</TD> </TR> <TR> <TD ROWSPAN = 2 COLSPAN = 3 ALIGN = center>Cell 5</TD> <TD>Cell 6</TD><TD>Cell 7</TD><TD>Cell 8</TD> </TR> <TR> <TD>Cell 9</TD><TD>Cell 10</TD><TD>Cell 11</TD><TD>Cell 12</TD> </TR> </TABLE> </BODY> </HTML> |