When writing in HTML, the
tag is a block element used to create a table. It is useful when you want to represent data using rows and columns. The basic elements that make up and affect the size of a table include| , | , and | . The following sections contain information about thetag, including an example of it in use, and related attributes and browser compatibility.Example of
code#| Month | Savings |
|---|
| March | $200 |
| April | $300 |
| May | $250 |
Example result#
We have added a few of our own classes to the table using CSS; this action allows us to improve its appearance.
More advanced tables may also include the
,,,,, orelements.- Example of
code- Example result
- Deprecated attributes
- Compatibility
- Related information
Deprecated attributes#
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. Every attribute that was unique to the
tag is deprecated. While these attributes may work with the some versions of HTML, they will eventually be phased out. You should use CSS to adjust the dimensions and appearance of this element.Compatibility#
Browser, Cell, Class, Column, Compatibility, Container tag, Format, Row, Table, Web design terms
- See our HTML tables overview for further examples and uses of tables.
- How to center a table in HTML.
- HTML and web design help and support.