Performance: Table headers
MEDIUM IMPACT
Using proper table headers affects page accessibility and rendering stability, impacting visual stability and user experience.
<table> <thead> <tr> <th scope="col">Name</th> <th scope="col">Age</th> </tr> </thead> <tbody> <tr> <td>Alice</td> <td>30</td> </tr> </tbody> </table>
<table> <tr> <td>Name</td> <td>Age</td> </tr> <tr> <td>Alice</td> <td>30</td> </tr> </table>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using <td> for headers | Minimal DOM nodes | Multiple reflows if styles change | Higher paint cost due to layout shifts | [X] Bad |
| Using <th> with scope | Minimal DOM nodes | Single reflow with stable layout | Lower paint cost with stable header rendering | [OK] Good |