webdevlinux - logo Web Dev Linux

HTML Table Horizontal merge

In this chapter, We will see how to use horizontal merge of table cells. Joining two or more adjacent cells together is also named as merge.

Table horizontal merge Table colspan

Try the example below.

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


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

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