7.5 Crafting HTML Tables

 

How do you express or organize vast amounts of data for your website? The answer could be found in the neat confines of a sturdy table, so to speak. Anna Fitzgerald of Hubspot mentioned that “tables allow the reader to see results or conclusions at a glance, rather than poring over text to find the numeric data or key points.” In her blog post, “How to Make & Edit Tables in HTML,” she elaborates further on the construction of the tables with her step-by-step breakdown of the tag used in a basic HTML table.

Tags for a Basic Table

  • The primary <table> tag is what houses all other tags or elements.
  • The <tr> or table row tag, is what establishes and groups the separate rows in your image.
  • The <th> tag stands for table header, and is where the user lists the names or labels of their rows.
  • The <td> tag stands for table data (or table cell) and is where the user records their raw information in text. Although, it’s not limited to text and can be filled with images, lists, and other tables.

A Finished Table

These two examples below show the difference between a unedited and an edited table. It can be constructed by editing and defining borders, paddings, centering rows, changing background color, and adjusting the font size.

Table by Anna Fitzgerald of Hubspot

Table by Anna Fitzgerald of Hubspot
Table by Anna Fitzgerald of Hubspot
Table by Anna Fitzgerald of Hubspot


Note: This chapter is a revised version of a blog post titled, “Crafting HTML Tables,” on Publishing Without Ink.

 

 

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Publishing for the Web Copyright © by TCOM 3335 (Spring 2021 and Fall 2022) at UHD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book