HTML Tables
The web is filled with text and images, but it's also filled with information like sports scores throughout the years, list of employee names and email addresses, or nutrition facts for your favorite foods. HTML tables enable the display information in what is commonly known as tabular data, which is information that's stored in a table-like structure of columns and rows. In general, anything that you might put into a spreadsheet could go in a table. There are many use cases for a table, so it's important to add them to your skills because it's a very common method for displaying information.
What you'll learn
- Table elements
- Organizing tables
Table Basics
Tables are a little bit more involved than other HTML elements like paragraphs and images, because in order to construct a table, you need to use elements to represent the individual table cells, the rows that contain those cells, as well as the table itself.
- Overview of Tables2:26
- Create a Basic Table5:40
- Create a Table4 objectives
- The Table Header Cell Element5:15
- Add Table Cell Headers1 objective
Extra Credit
Try creating a table on your own. You can create a table of financial data, nutrition facts, sports scores, or anything else you can imagine.
Structuring Tables
Extra structure can be helpful for automated pieces of software like search engines or screen readers, but it's also helpful for designers because it adds some additional elements that can be targeted with CSS.
- The Table Head and Body Elements3:06
- Add the Table Head and Body Elements1 objective
- The Table Foot Element5:08
- Add the Table Footer Element3 objectives
- The Caption Element1:25
- Add a Table Caption Element1 objective
- More Table Tips2:04
- HTML Tables Review6 questions
Extra Credit
If you continue to learn about front-end development, try adding somejQueryto your table. With the right plugin, you can add features like sorting and filtering to an otherwise static table.
If you learn about back-end languages likeRubyPHP,Python, or, try to see if you can populate a table dynamically by using data from a database.