HTML Table, thead, tbody, tfoot

By Xah Lee. Date: . Last updated: .

This page shows examples HTML table example with {caption, thead, tbody, tfoot} tags.

Table with Caption

Use caption for table's caption.

table example
1,1 1,2 1,3
2,1 2,2 2,3

Here is the source code:

<table border="1">
<caption>table example</caption>


Table with {thead, tbody, tfoot, th} Tags

The {thead, tbody, tfoot} do not have any default rendering. (use CSS for that)

When using thead or tfoot, you can use th instead of td, which will make it bold.

cats dogs
7 6
Cats win!

Here is the source code:

<table border="1">


<th colspan="2">Cats win!</th>

JS in Depth

HTML Basics

HTML Table


HTML4 Frameset