How to specify shorter version of the content in a header cell in HTML5 ?
In this article, we will learn how to specify a shorter version of the content in a header cell. This can be helpful for screen reader users as they do not need to read out larger headings or make it easy to understand known abbreviations. The <th> tag is used to specify the heading for an <table> element and the content of the heading is defined in-between the heading tags.
Approach: The abbr attribute of the <th> tag is used to specify an abbreviation of the header content. This will have no effect on a normal web browser. However, screen readers would be able to read the information.
The below examples illustrate the abbr attribute to specify the shorter version of the content of the header cell.
Output: The abbreviations would not be displayed as normal web browsers do not display them.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.