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:
Monday | Tuesday | |
---|---|---|
Morning | Off | Work |
Afternoon | Party |
Instructions
Add the rowspan
attribute with a value of 2
to any td
element in the second row (tr
).
Start programming for free
6/7