5/8/25, 11:39 AM HTML Tables
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
HTML Tables
❮ Previous Next ❯
HTML tables allow web developers to arrange data into rows and columns.
Example
Company Contact Country
Alfreds Futterkiste Maria Anders Germany
Centro comercial Moctezuma Francisco Chang Mexico
Ernst Handel Roland Mendel Austria
Island Trading Helen Bennett UK
Laughing Bacchus Winecellars Yoshi Tannamuri Canada
Magazzini Alimentari Riuniti Giovanni Rovelli Italy
Try it Yourself »
https://www.w3schools.com/Html/html_tables.asp 1/10
5/8/25, 11:39 AM HTML Tables
Define
an HTML
Tutorials Exercises Table
Services Sign Up Log in
HTML
A table CSS
in HTMLJAVASCRIPT SQLcells PYTHON
consists of table inside rows JAVA PHP
and columns. HOW TO W3.CSS C
Example
A simple HTML table:
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
Try it Yourself »
Table Cells
Each table cell is defined by a <td> and a </td> tag.
td stands for table data.
https://www.w3schools.com/Html/html_tables.asp 2/10
5/8/25, 11:39 AM HTML Tables
Everything between <td> and </td> is the content of a table cell.
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
Example
<table>
<tr>
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
</table>
Try it Yourself »
Note: A table cell can contain all sorts of HTML elements: text, images, lists, links, other
tables, etc.
ADVERTISEMENT
Table Rows
Each table row starts with a <tr> and ends with a </tr> tag.
tr stands for table row.
Example
<table>
<tr>
<td>Emil</td>
https://www.w3schools.com/Html/html_tables.asp 3/10
5/8/25, 11:39 AM HTML Tables
<td>Tobias</td>
Tutorials
<td>Linus</td>Exercises Services Sign Up Log in
</tr>
HTML
CSS
<tr> JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table>
Try it Yourself »
You can have as many rows as you like in a table; just make sure that the number of
cells are the same in each row.
Note: There are times when a row can have less or more cells than another. You will
learn about that in a later chapter.
Table Headers
Sometimes you want your cells to be table header cells. In those cases use the <th> tag
instead of the <td> tag:
th stands for table header.
Example
Let the first row be table header cells:
<table>
<tr>
<th>Person 1</th>
https://www.w3schools.com/Html/html_tables.asp 4/10
5/8/25, 11:39 AM HTML Tables
<th>Person 2</th>
Tutorials 3</th>
<th>Person Exercises Services Sign Up Log in
</tr>
HTML
CSS
<tr> JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
<tr>
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table>
Try it Yourself »
By default, the text in <th> elements are bold and centered, but you can change that
with CSS.
?
Exercise
What is the correct tag name for a table-cell in HTML?
<tc>
<td>
<tr>
Submit Answer »
HTML Table Tags
https://www.w3schools.com/Html/html_tables.asp 5/10
5/8/25, 11:39 AM HTML Tables
Tag Tutorials Description
Exercises Services Sign Up Log in
<table> Defines a table
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
<th> Defines a header cell in a table
<tr> Defines a row in a table
<td> Defines a cell in a table
<caption> Defines a table caption
<colgroup> Specifies a group of one or more columns in a table for formatting
<col> Specifies column properties for each column within a <colgroup>
element
<thead> Groups the header content in a table
<tbody> Groups the body content in a table
<tfoot> Groups the footer content in a table
For a complete list of all available HTML tags, visit our HTML Tag Reference.
Video: HTML Tables
https://www.w3schools.com/Html/html_tables.asp 6/10
5/8/25, 11:39 AM HTML Tables
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
❮ Previous Next ❯
Track your progress - it's free! Sign Up Log in
ADVERTISEMENT
https://www.w3schools.com/Html/html_tables.asp 7/10
5/8/25, 11:39 AM HTML Tables
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
COLOR PICKER
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
PLUS SPACES
GET CERTIFIED FOR TEACHERS
https://www.w3schools.com/Html/html_tables.asp 8/10
5/8/25, 11:39 AM HTML Tables
Tutorials Exercises
FOR BUSINESS
Services
CONTACT US
Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial
Top References
HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
Angular Reference
jQuery Reference
Top Examples Get Certified
HTML Examples HTML Certificate
CSS Examples CSS Certificate
JavaScript Examples JavaScript Certificate
How To Examples Front End Certificate
SQL Examples SQL Certificate
Python Examples Python Certificate
W3.CSS Examples PHP Certificate
Bootstrap Examples jQuery Certificate
PHP Examples Java Certificate
Java Examples C++ Certificate
XML Examples C# Certificate
jQuery Examples XML Certificate
FORUM ABOUT ACADEMY
W3Schools is optimized for learning and training. Examples might be simplified to improve
reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot
https://www.w3schools.com/Html/html_tables.asp 9/10
5/8/25, 11:39 AM HTML Tables
warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of use,
Tutorials Exercises Services
cookie and privacy policy.
Sign Up Log in
HTML
Copyright
CSS 1999-2025 by Refsnes
JAVASCRIPT SQLData. PYTHON
All Rights Reserved.
JAVA W3Schools
PHP is Powered
HOW TOby W3.CSS.
W3.CSS C
https://www.w3schools.com/Html/html_tables.asp 10/10