Row Span

Row span is achieved in the same way as column span, just change the attribute name from colspan to rowspan.

Row span solves the same problem as column span, which is that sometimes we need to place data in multiple cells of a table.

<body>
	<table>
		<tr>
			<th></th>
			<th>Monday</th>
			<th>Tuesday</th>
		</tr>
		<tr>
			<th>Morning</th>
			<td rowspan="2">Off</td>
			<td>Work</td>
		</tr>
		<tr>
			<th>Afternoon</th>
			<td>Party</td>
		</tr>
	</table>
</body>

This code could be displayed as follows:

MondayTuesday
MorningOffWork
AfternoonParty

Instructions

Add the rowspan attribute with a value of 2 to any td element in the second row (tr).

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

6/7