How to create cell that spans two or more rows or columns.
Code:
<html><body><h4>Cell that spans two rows</h4><tableborder="5"><tr><td>Name</td><td>P. Ivanov</td></tr><tr><tdrowspan="2">e-mail</td><td>ivanov@yahoo.com</td></tr><tr><td>p_iv@yahoo.com</td></tr></table><h4>Cell that spans three columns</h4><tableborder="5"><tr><td>Name</td><tdcolspan="3">e-mail</td></tr><tr><td>P. Ivanov</td><td>ivanov@yahoo.com</td><td>p_iv@yahoo.com</td><td>p_ivanov@yahoo.com</td></tr></table></body></html>
Play with the code:
See working example:
Explanation:
To create a cell that spans on two or more rows, use the rowspan property of the <td> tag to set the number of the rows that the cell will span.
To create a cell that spans on two or more columns, use the colspan property of the <td> tag to set the number of the columns that the cell will span.