Grokking HTML
0% completed
Merging Cells With colspan and rowspan
<table> <tr> <th rowspan="2">Breads</th> <td>Sourdough loaf</td> <td>$6.50</td> </tr> <tr> <td>Rye loaf</td> <td>$5.75</td> </tr> </table>
The second row of this table contains only two cells, yet the table has three columns, and nothing looks missing. "Rye loaf" appears in the second column, directly under "Sourdough loaf", not in the first. The reason is the attribute rowspan="2" on the "Breads" cell. It makes that cell two rows tall, so "Breads" fills the first column of both rows, and the second row has no room left in its first column.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%