Key Concepts

Review core concepts you need to learn to master this subject

<td> Table Data Element

<table> <tr> <td>cell one data</td> <td>cell two data</td> </tr> </table>

The table data element, <td>, can be nested inside a table row element, <tr>, to add a cell of data to a table.

HTML Tables
Lesson 1 of 1
  1. 1
    There are many websites on the Internet that display information like stock prices, sports scores, invoice data, and more. This data is naturally tabular in nature, meaning that a table is often th…
  2. 2
    Before displaying data, we must first create the table that will contain the data by using the element. The element will contain all of the tabular data we plan on displaying.
  3. 3
    In many programs that use tables, the table is already predefined for you, meaning that it contains the rows, columns, and cells that will hold data . In HTML, all of these components must be crea…
  4. 4
    Rows aren’t sufficient to add data to a table. Each cell element must also be defined. In HTML, you can add data using the table data element: . 73 81 In the example a…
  5. 5
    Table data doesn’t make much sense without titles to describe what the data represents. To add titles to rows and columns, you can use the table heading element: . The table heading element is…
  6. 6
    So far, the tables you’ve created have been a little difficult to read because they have no borders. In older versions of HTML, a border could be added to a table using the border attribute and s…
  7. 7
    What if the table contains data that spans multiple columns? For example, a personal calendar could have events that span across multiple hours, or even multiple days. Data can span columns using…
  8. 8
    Data can also span multiple rows using the rowspan attribute. The rowspan attribute is used for data that spans multiple rows (perhaps an event goes on for multiple hours on a certain day). It acc…
  9. 9
    Over time, a table can grow to contain a lot of data and become very long. When this happens, the table can be sectioned off so that it is easier to manage. Long tables can be sectioned off using …
  10. 10
    In the last exercise, the table’s headings were kept inside of the table’s body. When a table’s body is sectioned off, however, it also makes sense to section off the table’s column headings using …
  11. 11
    The bottom part of a long table can also be sectioned off using the element. Quarter Revenue Costs Q1 $10M $7.5M …
  12. 12
    Tables, by default, are very bland. They have no borders, the font color is black, and the typeface is the same type used for other HTML elements. CSS
  13. 13
    Great job! In this lesson, we learned how to create a table, add data to it, and section the table into smaller parts that make it easier to read. Let’s review what we’ve learned so far: - The …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo