Creating tables in HTML, what are the tags and attributes
Creating tables on site pages is a fairly frequent process, so you need to know how to create them correctly. Tables allow you to present the material in an easy-to-read form, information from the tables is better remembered.
There are special tags for creating tables in HTML - table, tr, th, td . This is the minimum set of tags needed to make almost any table. But there are other tags that you might need. Below is a complete list of such tags:
- table - creates a table, available attributes: align, background, bgcolor, border, bordercolor, cellpadding, cellspacing, cols, frame, height, rules, summary, width ;
- thead - designed to store one or more rows at the very top of the table, attributes: align, char, charoff, bgcolor, valign ;
- tbody - designed to store one or more rows in the middle of the table, attributes: align, char, charoff, bgcolor, valign ;
- tfoot - designed to store one or more rows at the very end of the table, attributes: align, char, charoff, bgcolor, valign ;
- tr - serves as a container for creating a table row, attributes: align, bgcolor, bordercolor, char, charoff, valign ;
- th - serves to create table headers, attributes: abbr, align, axis, background, bgcolor, bordercolor, char, charoff, colspan, headers, height, nowrap, rowspan, scope , valign, width ;
- td - creates a table cell, attributes: abbr, align, axis, background, bgcolor, bordercolor, char, charoff, colspan, headers, height, nowrap, rowspan, scope, valign , width ;
- caption - sets the table caption, attributes: align, valign ;
- colgroup - designed to set the width and style of one or more table columns, attributes: align, char, charoff, span, valign, width ;
- col - sets the width and other characteristics of one or several columns of the table, attributes: align, char, charoff, span, valign, width .
There are various ways to create tables in HTML using tags and the required attributes. Some of the attributes are recommended not to be used, but instead to resort to styling styles correctly with CSS Styles . Thanks to CSS, you can significantly change the appearance of the table, there are special properties for tables - both universal and specific.
Latest articles
- 09.07.22IT / Misc Convert office files DOC, DOCX, DOCM, RTF to DOCX, DOCM, DOC, RTF, PDF, HTML, XML, TXT formats without loss and markup changes
- 07.07.22IT / Safety How to protect PHP, JS, HTML, CSS source code - obfuscation, minification, compression and encryption
- 06.07.22IT / Safety Connection not secure, problem with Lets Encrypt - how to fix expired 09/30/2021 DST Root CA X3, remove it manually and install ISRG Root X1. Example on MS Windows 7
- 08.07.21IT / Misc How to make a free translation for a website without an API, translate documents in Google Translate
- 06.07.21IT / Misc How to make a subscription button on a website, a subscriber base and automatic mailing