Mar
6th
Files under HTML & CSS |
1,455 views
Every webmaster also know that table cells can be spanned more than one column or row. The attribute of ROWSPAN is used to make cell span multiple rows. If let say ROWSPAN=”3″ it will only span a column vertically across three rows.
<table border=”1″ cellspacing=”2″ cellpadding=”2″ width=”200px”>
<tbody>
<tr>
<td>Codebasic.net</td>
<td rowspan=”2″>spanned</td>
<td>myLengLui.com</td>
</tr>
<tr>
<td>imDavidLee.com</td>
<td>LifeTechie.com</td>
</tr>
<tr>
<td>LimPek.com</td>
<td>innoDesigner.com</td>
<td>PenangBlogger.com</td>
</tr>
</tbody></table>
<tbody>
<tr>
<td>Codebasic.net</td>
<td rowspan=”2″>spanned</td>
<td>myLengLui.com</td>
</tr>
<tr>
<td>imDavidLee.com</td>
<td>LifeTechie.com</td>
</tr>
<tr>
<td>LimPek.com</td>
<td>innoDesigner.com</td>
<td>PenangBlogger.com</td>
</tr>
</tbody></table>
| Codebasic.net | spanned | myLengLui.com |
| imDavidLee.com | LifeTechie.com | |
| LimPek.com | innoDesigner.com | PenangBlogger.com |
The COLSPAN attribute is to make a cell span multiple columns. It spans the columns and will make your table cell span horizontally.
<table border=”1″ cellpadding=”2″ cellspacing=”2″ width=”200px”>
<tr>
<th colspan=”2″>Codebasic.net</th>
</tr>
<tr>
<td width=”20%”>imDavidLee.com</td><td>LifeTechie.com</td>
</tr>
</table>
<tr>
<th colspan=”2″>Codebasic.net</th>
</tr>
<tr>
<td width=”20%”>imDavidLee.com</td><td>LifeTechie.com</td>
</tr>
</table>
| Codebasic.net | |
|---|---|
| imDavidLee.com | LifeTechie.com |