Search
Categories
Ad

Advanced Tables

Problem

I want to merge two or more cells in a HTML Table

Solution

You can use “colspan” or “rowspan” attributes.

merged cell
cell1 cell2 cell3

<tr><th colspan="3">merged cell</th></tr>
<tr><td>cell1</td><td>cell2</td><td>cell3</td></tr>
merged cell2 cell3
cell4 cell5

<tr><td rowspan="2">merged</td><td>cell2</td><td>cell3</td></tr>
<tr><td>cell4</td><td>cell5</td></tr>

Tags: ,

Leave a Reply