Search⌘ K

How It Works: Scrolling the Table Body

Explore how to dynamically generate table rows with JavaScript and use HTML semantic elements to achieve a scrollable table body. Understand the role of thead, tbody, and tfoot in structure and printing. Gain skills to enhance web pages with scrollable content areas efficiently.

How it works

The JavaScript shown in step one creates 100 rows in a loop. It generates two random numbers and adds a new table row with two columns; one with the definition of adding the two random numbers, and another with the ...