Search DaTutorials:  
HOME
Html Tutorials
Basics
Forms
Frames
Hyperlinks and URLS
Images
Lists
Background
Colors
Fonts
Tables
Meta Tags
Events
Javascript Integration
Sound
Other
Search For a Tutorial
Html Reference

Table cells that span more than one row/column

Description:


How to create cell that spans two or more rows or columns.

Code:

<html>
<body>


<h4>Cell that spans two rows</h4>
<table border="5">
<tr>
  <td>Name</td>
  <td>P. Ivanov</td>
</tr>
<tr>
  <td rowspan="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>
<table border="5">
<tr>
  <td>Name</td>
  <td colspan="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.

See Also:

HTML: Html, Body, Table, Tr, Td, Th


Online Html Forum  Discuss this tutorial in our HTML forum


     Ringtone | Car Insurance | Credit Cards | Reno Nevada Real Estate | Fast Loans
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp