John Lennon | Rhythm Guitar |
Paul McCartney | Bass |
George Harrison | Lead Guitar |
Ringo Starr | Drums |
Tables in HTML5
The HTML elements that allow you to build tables
New! My 44-page ebook "CSS in 44 minutes" is out! 😃
# table
Defines a container for tabular data.
Example: Copy
Name | Instrument |
---|---|
Name | Instrument |
John Lennon | Rhythm Guitar |
Paul McCartney | Bass |
George Harrison | Lead Guitar |
Ringo Starr | Drums |
# tbody
Defines a group of table rows <tr>
.
Example: Copy
Name | Instrument |
---|---|
Name | Instrument |
John Lennon | Rhythm Guitar |
Paul McCartney | Bass |
George Harrison | Lead Guitar |
Ringo Starr | Drums |
# td
Defines a table cell. Must be a direct child of a <tr>
.
Example: Copy
colspan
Defines how many columns a cell should span across.
"3"
You can use any integer.
rowspan
Defines how many rows a cell should span across.
"2"
You can use any integer.
# tfoot
Defines a group of table rows <tr>
at the end of a <table>
.
Example: Copy
Name | Instrument |
---|---|
Name | Instrument |
John Lennon | Rhythm Guitar |
Paul McCartney | Bass |
George Harrison | Lead Guitar |
Ringo Starr | Drums |
# th
Defines a table header. Must be a direct child of a <tr>
.
Example: Copy
colspan
Defines how many columns a cell should span across.
"3"
You can use any integer.
rowspan
Defines how many rows a cell should span across.
"2"
You can use any integer.
# thead
Defines a group of table rows <tr>
at the start of a <table>
.
Example: Copy
Name | Instrument |
---|---|
Name | Instrument |
John Lennon | Rhythm Guitar |
Paul McCartney | Bass |
George Harrison | Lead Guitar |
Ringo Starr | Drums |
# tr
Defines a table row.
Example: Copy