HTML Table Rowspan and Colspan
HTML Tutorial » HTML Table Rowspan and Colspan
- rowspan: Allows a single table cell to span the height of more than one cell or row.
- colspan: Allows a single table cell to span the width of more than one cell or column.
Both colspan and rowspan are attributes of the two table-cell elements, <th> and <td>.
Syntax
<td rowspan="number">
<td colspan="number">
HTML Table rowspan - examples
Example:
Example 1 HTML Table rowspan:
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Rowspan</title>
</head>
<body>
<table style="background:#FFFFCC; width:100%; border:thick #FF3333">
<tr>
<td style="border:1px solid #006699; witdh:100%;"> January </td>
<td style="border:1px solid #FF3333; witdh:100%;"> 12 </td>
<td style="border:1px solid #FF3333; witdh:100%;"> 08 </td>
<td rowspan="3" style="border:1px solid #00FF66; witdh:100%; background:#00FF66"> 23 </td>
</tr>
<tr>
<td style="border:1px solid #006699; witdh:100%;"> February </td>
<td rowspan="2" style="border:1px solid #FF3333; witdh:100%; background:#FFAAAA"> 14 </td>
<td style="border:1px solid #FF3333; witdh:100%;"> 09 </td>
</tr>
<tr>
<td style="border:1px solid #006699; witdh:100%;"> March </td>
<td style="border:1px solid #FF3333; witdh:100%;"> 06 </td>
</tr>
</table>
</body>
</html>
Note: Browser Support Rrowspan
HTML Table colspan - examples
Example:
Example 1 HTML Table colspan:
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Colspan</title>
</head>
<body>
<table style="background:#FFFFCC; width:100%; border:thick #FF3333">
<tr>
<td style="border:1px solid #006699; witdh:100%;"> January </td>
<td colspan="2" style="border:1px solid #FF3333; witdh:100%; background:#66FFFF"> 12 </td>
<td style="border:1px solid #00FF66; witdh:100%;"> 23 </td>
</tr>
<tr>
<td style="border:1px solid #006699; witdh:100%;"> February </td>
<td style="border:1px solid #FF3333; witdh:100%;"> 14 </td>
<td style="border:1px solid #FF3333; witdh:100%;"> 09 </td>
<td style="border:1px solid #FF3333; witdh:100%;"> 09 </td>
</tr>
<tr>
<td style="border:1px solid #006699; witdh:100%;"> March </td>
<td colspan="3" style="border:1px solid #FF3333; witdh:100%; background:#66FFFF"> 06 </td>
</tr>
</table>
</body>
</html>
Note: Browser Support Colspan
html table rowspan and colspan
HTML Table Rowspan and Colspan - html tutorial
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout
Find here examples of creative and unique website layouts.
Free CSS HTML Menu
Find here examples of creative and unique website CSS HTML menu.