Lesson 8 – HTML tables

HTML tables are created using table tags. Headings are created in the table using th tags and rows are created using the tr tags. Cells are created using td elements.

Default tables

See the Pen HTML table without border by Curt (@curtsahd) on CodePen.

By default HTML tables don’t have borders. To add borders to tables you can apply the following CSS:

table, th, td { border: 1px solid black; }

See the Pen HTML table with border by Curt (@curtsahd) on CodePen.



### Colspan tables

HTML tables can have cells which span multiple columns through the use of the colspan attribute:

See the Pen HTML table with colspan by Curt (@curtsahd) on CodePen.