HTML table tag

Html <table> tag defines a table. Table collects the data in table rows and columns (2-D form).

Example

Countries Population Area
China 7,432,663,275 9,572,900
India 1,382,323,332 3,287,263
Try </>

Here, the integral value in the border attribute defines the thickness of the border.

Related tags

TagsDescription
<tr> defines a table row in a table.
<table> <tr> table row is present here </tr> </table>
<th> defines a cell in the table heading section of table.
<table> <tr><th> heading data is present here </th> </tr> </table>
<td> defines a cell of data in a table.
<table> <tr><td> cell data is present here </td> </tr> </table>

Tag omission

Both starting and ending tags are necessary.

Global Attributes

All the global attributes are applicable on the table element.

Specific Attributes

AttributesDescription
border border attribute specifies a border for the table.
<table border="an integer"> <tr><td> </td></tr> </table>


Was this article helpful?

 

Email:

Message:

Get the newsletter