Bottom HTML table title

The other day we saw how it could put a title in HTML table using caption element. In this example we are going to see how to have a table title HTML bottom, that is, the title is seen after the table.

The first thing will be to put the table title HTML using the element caption.

Demographic Data
Country Capital Surface Inhabitants

We must remember that the caption element must come right after the table element and that the text will correspond to the title of the table.

Now let’s see how to put the table title HTML below and we will do this using a CSS style and specifically through the caption-side attribute. At caption-side attribute we can give it the values ​​«bottom» or «top», depending on whether we want to have it above the table or below the table.

So if we want the table title HTML at the bottom we must configure the CSS as follows:

caption {
    caption-side: bottom;
}

Leave a Comment