HTML <table> tag
HTML <table> tag
The <table>
tag specifies an HTML table.
A basic HTML table contains the following child elements.
A complex HTML table may also include the following child elements.
- caption (<caption>)
- column (<col>)
- column group (<colgroup>)
- table header (<thead>)
- table body (<tbody>)
- table footer (<tfoot>)
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body>
<table>
<tr>
<th>S.No</th>
<th>Name</th>
</tr>
<tr>
<td>1</td>
<td>Brendan</td>
</tr>
<tr>
<td>2</td>
<td>Eich</td>
</tr>
</table>
</body>
</html>
Attributes
There is no special attributes for <table> tag. Only Global attributes.
Deprecated Attributes
The following attributes should not be used in any case.
Attribute | Value | Explanation |
---|---|---|
align |
| Specifies how the table must be aligned inside the containing document. |
bgcolor |
| Specifies the background color of a table. |
border |
| Specifies whether to apply a border for a table or not. |
cellpadding | px | Specifies the space between the content of a cell and its border. |
cellspacing | px | Specifies the space between two cells. |
frame |
| Specifies which side of the frame surrounding the table must be displayed. |
rules |
| Specifies how the line in the table should appear. |
summary | text | Specifies an alternative text that summarizes the content of the table. |
width | px / % | Specifies the width of the table. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.