Note: If you don't know what an element/tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.
Table of contents
Bypass table of contentsThe HTML tfoot element defines a footer section in a table (HTML table element). When it's present, it must contain one or more rows that are supposed to provide footer information for data cells.
There are more benefits than the semantic in marking up headers (HTML thead element) and footers in a table. For example, when a large table is printed in more than one page, browsers can print headers and footers on each page, improoving the legibility of the table.
Authors should place table footers after headers (HTML thead element) and before the body or bodies (HTML tbody element). The reason to place something that will be shown at the bottom first, is that user agents can display information as they receive it, being able to show header and footer information in a table while the data cells are being loaded. This becomes very useful when the table is very large.
This element isn't rendered by most user agents, but the semantic information it can provide makes it very important when showing tabulated data.
The next table is defined with a header (HTML thead element) and a footer. The benefits of the footer would be more evident in a larger table.
| User | Points | Active |
|---|---|---|
| sammy | 248 | Yes |
| jhon45 | 146 | Yes |
| ackbard | 801 | No |
| User | Points | Active |
The "id" attribute assigns an identifier to the associated element. This identifier must be unique in the document and can be used to refer to that element in other instances (e.g., from client-side scripts).
The "class" attribute assigns a class name (or a list of class names separated by spaces) to the container element. It's used together with style sheets and tells the browser the class (or classes) to which the element is associated with.
A class gives presentational attributes to elements (read more at the Cascading Style Sheets tutorial).
This attribute is used to define presentational attributes for the containing element, and its value should be composed by style sheets properties. Although, in some cases, it can become useful, a better practice is to place presentational attributes in external files, relating them to elements with the "class" attribute. This way you keep the semantic and presentational parts of your document separated.
You can find more information about presentational attributes at the Cascading Style Sheets tutorial.
The purpose of this attribute is to provide a title for the element. Its value must be a short and accurate description of the element. Browsers usually render it as a "tool tip" when the user puts the mouse pointer over the element for a small period of time.
Specifies the language of an element's content. The default value in "unknown".
When writing XHTML 1.0 documents, the attribute used to specify the language of an elements is "xml:lang". For forward and backward compatibility both attributes can be used simultaneously like in the example below. Note, that in XHTML 1.1 the "lang" attribute has been completely replaced by "xml:lang" and its use is no longer valid.
This attribute indicates the direction in which the texts of the element must be read. This includes content, attribute values and tables. It has two possible values that are case-insensitive:
Defines how the text of the cells inside the element is horizontally aligned. It has five possible case-insensitive values:
Defines how the text of the cells inside the element is vertically aligned. Its possible case-insensitive values are:
Indicates a single character that acts as alignment axis for the text of every cell inside the element. The default value is the decimal point character for the current language.
Note that browsers aren't required to support this feature, so the compatibility using this attribute could be reduced.
Specifies the offset to the first occurrence of the alignment character on each line, considering the text direction.
Note that browsers aren't required to support this feature, so the compatibility using this attribute could be reduced.
See a complete list and information about events in HTML
Diseño y desarrollo: Latitud29.com