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. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *