Performance: Table rows and columns
MEDIUM IMPACT
This affects page load speed and rendering performance by increasing DOM size and layout complexity when many table rows and columns are used.
<table> <thead> <tr><th>Item</th><th>Detail</th><th>Extra</th></tr> </thead> <tbody> <!-- Render only visible rows with pagination or virtual scrolling --> </tbody> </table>
<table> <tr><td>Item 1</td><td>Detail 1</td><td>Extra 1</td></tr> <!-- Repeat hundreds of rows --> </table>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Large table with 1000+ rows and many columns | Very high (1000+ rows) | Hundreds of reflows | High paint cost | [X] Bad |
| Table with pagination showing 20 rows at a time | Low (20 rows) | Single reflow per page | Low paint cost | [OK] Good |
| Table with virtual scrolling rendering visible rows only | Minimal DOM nodes | Minimal reflows | Minimal paint cost | [OK] Good |