Tables - Part 2 (colspan and rowspan)

Web Design with HTML & CSS

🕑 This lesson will take about 10 minutes

This tutorial explains how to use the colspan and rowspan properties in a table. These properties allow you to spread a cell over multiple columns or rows. The colspan and rowspan properties basically allow you to customise the layout and arrangement of data in a table. Along with some CSS code to create a theme for your table, these properties can be used to make a boring meaningless table into an effective table that conveys the information it stores in an effective manner.

Watch the video below and then scroll down to see the examples and sample code.

Here is some sample code showing how to use the rowspan property. Some CSS code is also used to add borders and centre the text.

Here is some sample code showing how to use the colspan property.