webdevlinux - logo Web Dev Linux

HTML Table Vertical merge

Vertical merge is used to join adjacent table cells in a single column. In this chapter, You will see how to merge table cells vertically.

Table vertical merge Table rowspan

Try the example below.

FILE : table-vertical-merge.html
<!DOCTYPE html>
<meta charset="utf-8" />
<title>Merge cells vertically</title>
<table border="1">
		<th>Week days</th>	
		<td rowspan="2">Sleep</td>
		<td>Watch TV</td>
		<td>Watch TV</td>
		<td>Watch a Movie</td>


Take a look at the explanation of an attribute used in the example.

We use the rowspan attribute on the element td to merge vertically. Attribute value represents the number of cells to be merged.