search
Login

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

0 votes
24 views
asked Geek 15.3k points 16 41 63

1 Answer

0 votes
The headers attribute from td and th elements can be used to make tables easier to process with screen readers. The value of the headers attribute is the ID attribute value of one or more th cells.
 
<!DOCTYPE HTML> 
<html> 
<head> 
<style> 
thead th{ text-align:left; background:grey; color:white} 
tbody th { text-align:right; background: lightgrey; color:grey} 
</style> 
</head> 
<body> 
    <table> 
        <thead> 
            <tr> 
               <th id="rank">Rank</th><th id="name">Name</th><th id="color">Color</th> 
            </tr> 
        </thead> 
        <tbody> 
            <tr> 
                <th id="first" headers="rank">Favorite:</th><td headers="name first">Mango</td><td headers="color first">Yellow</td> 
            </tr> 
        <tr> 
            <th id="second" headers="rank">2nd Favorite:</th><td headers="name second">Oranges</td><td headers="color second">Orange</td> 
        </tr> 
        </tbody> 
    </table> 
</body> 
</html>
 
answered Sr Member 4.8k points 10 25 31

Related questions

0 votes
1 answer 13 views
13 views
asked sunny Expert 11.4k points 14 22 28
0 votes
1 answer 17 views
17 views
asked rock Expert 15k points 15 23 30
0 votes
1 answer 15 views
15 views
asked omari Sr Member 3.9k points 5 8 12
0 votes
1 answer 22 views
0 votes
1 answer 59 views
59 views
asked omari Sr Member 3.9k points 5 8 12
...