The table tag – create an HTML table quickly and easily
The table element is used together with the child elements tr, td, th to add tabular data to an HTML document.
Tables for data, not layout
It used to be common to use HTML tables to control the layout of a web page. Using them in this way is not only semantically incorrect, but it can also create accessibility issues and make it much more difficult to create an adaptive website design.
So, how to use HTML tables correctly? To display a set of data that is easiest to understand and assimilate if it is presented in table form. If you have such data to add to a website, an HTML table is the right tool for the job.
HTML table attributes
There are many parameters that are used when creating an HTML table.
|height||Specifies the height of the table.|
|summary||Specifies the description of the table.|
|width||Specifies the width of the table.|
In HTML5, however, many have become obsolete, losing basic styling properties.
|frame||Used to specify visible table borders.|
|rules||Used to specify the display of internal borders between rows and columns.|
|align||Used to align the HTML table left, right, or centered relative to the parent element.|
CSS should be used instead for more correct and fine-tuning.