HTML Table Tag

In HTML, the <table> tag is used to represent data in a tabular format on the web pages.

  • With tabular format we mean that information is present in two-dimensional format comprises of rows and columns of cells containing data.

  • Also, it is a Block-Level Element

  • In order to define a row of a table <tr> tag is used and to define table cell <td> tag is used.

  • To provider header of a table <th> tag is used.

  • To provide a caption to a table <caption> tag is used.

HTML <table> Tag Syntax and Usage

The <table> tag requires the start(opening) tag and end(closing) tag.

Following is the syntax for using the table tag in your HTML code:

<table>
...content here
</table>

HTML <table> Tag Basic Example

Below we have a basic example showing how we use the HTML table tag

HTML <table> Tag Attributes

This element does not have any specific attributes although this element supports Global and Event attributes.

Default CSS settings for HTML <table> Tag

table {
  display: table;
  border-collapse: separate;
  border-spacing: 2px;
  border-color: gray;
}

Browser Support for HTML <table> Tag

Following browsers support this attribute:

  • Google Chrome 6.0+

  • Internet Explorer 9.0+

  • Firefox 4+

  • Opera 11.1+

  • Safari 5.0+