Skip to main content
CSS is fun and cool and I like it.
Article

A Complete Guide to the Table Element

The <table> element in HTML is used for displaying tabular data. You can think of it as a way to describe and display data that would make sense in spreadsheet software. Essentially: columns and rows. In this article, we’re going to look at how to use them, when to use them, and everything else you need to know.

A Very Basic Example

Here’s a very simple demo of tabular data:

CodePen Embed Fallback

It is data that is useful across … Read article “A Complete Guide to the Table Element”

Snippet

Persistant Headers on Tables

When you scroll down a page with a long table on it, typically the header of the table scrolls away and becomes useless. This code clones the table header and applies it at the top of the page once you have scrolled beyond it, and disappears when you have scrolled past the table.

These days, you’re probably better off using position: sticky; than using JavaScript, but you’ll have to make that browser support call on your own.

function UpdateTableHeaders() {
   
Read article “Persistant Headers on Tables”