How can "th" elements be made to work as row headers instead of column headers?
- By setting the "axis" attribute to "row".
- By setting the "display" CSS property to "row".
- By setting the "scope" attribute to "row".
- By using JavaScript.
In HTML tables, by default, the "th" elements act as column headers. However, if you want a "th" element to serve as a row header, you should use the "scope" attribute and set its value to "row". This also helps assistive technologies like screen readers to interpret the table correctly.
Loading...
Related Quiz
- Imagine that you are tasked with creating a data table that has numerous columns and rows. The first two columns contain critical information, while the rest can be viewed on demand. How would you approach designing this table responsively?
- What is the role of the "style" attribute in HTML elements?
- How does browser support affect the usage of image maps, and what are the alternatives?
- HTML comments can be used to _____ sections of code for testing purposes.
- Which attribute is used in the video tag to make sure the video controls like play, pause, and the seek bar are available to the user?