HTML <data> Tag: The HTML<data> tag is used to link the content with the machine-readable translation. And this HTML data tag supports only global attributes. This element provides both a machine-readable value for data processors and a human-readable value for rendering in a browser.
HTML <data> Tag
There are two kinds of cells in the table. If the content is the date or time-related content, then use <time> element instead of a data element. All layout attributes are removed except colspan, headers, and rowspan.
- Header cells, which specifies the header information using <th>.
- Standard cells, which specifies the data using the <td> tag.
Syntax: <data> Text </data>
Attributes
This HTML data tag contains single attributes data which holds the machine-readable translation of the content.
Browser compatibility
The HTML<data> tag is supported by a different type of browsers.
- Chrome-62.0
- Firefox-22.0,
- Safari-doesn’t support
- Opera-49.0
- InternetExplorer.
Example:
<!DOCTYPE html> <html> <body> <ul> <li><data value="21053">C</data></li> <li><data value="21054">C++</data></li> <li><data value="21055">HTML</data></li> </ul> </body> </html>
Output:
Attributes that are supported by the <data> tag
Attribute | Value | Description |
---|---|---|
value | machine-readable format | Describes the machine-readable translation of the content of the element |