From the course: HTML Essential Training

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

HTML tables

HTML tables

- In the '90s and early 2000s, tables were commonly used to create page layouts. But since then, new improvements to HTML and CSS have made this practice outdated, though you may still see it being used on old websites. Today, tables are mainly used for organizing data in rows and columns, like a price list or a comparison chart. One exception is HTML emails where tables are still needed for layouts. Let's take a look at the different parts that make up a basic HTML table. All forms start with a table tag. The caption element is optional, but can be added to provide a brief description of the table's contents. The rows in a table are created using the tr tag. The th tag is used for table headers. They're usually added as the first row to create a header for each column. To add data to the rows, use a td tag. Let's open an example in CodePen to see what a basic table looks like. By default, the data is displayed in rows and columns. Each piece of table data appears in its own box…

Contents