rowspan and colspan attributes

The colspan attribute is used to expand the cell horizontally while the rowspan attribute expands the cell vertically. Example:

<html>

<head>

<title>Table</title>

<body>

<h3>Table</h3>

<table border="1">

<tr>

<td>row 1, cell 1</td>

<td colspan="2">Row expanded horizontally</td>

</tr>

<tr>

<td rowspan="2">Row expanded vertcally</td>

<td>row 2, cell 2</td>

<td>row2, cell 3</td>

</tr>

<tr>

<td >row 3, cell 1</td>

<td>row 3, cell 2</td>

</tr>

</table>

</body>

</html>

 






This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.