HTML & CSS · Senior · Question 46 of 75

A 10,000-row table lags when scrolling. Which solution is most effective?

Explanation

The main problem is thousands of DOM nodes: memory, layout and styles. Virtualization (TanStack Virtual, react-window) keeps dozens of rows in the DOM and swaps them while scrolling. will-change on thousands of elements eats memory. Changing the markup doesn't reduce node count. Simpler alternatives are pagination or content-visibility.

Further reading

Problem with a question

HTML & CSS · Senior · question 46

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz