Problem Statement
Create a responsive table that scrolls horizontally on small screens.
Explanation
To make a table responsive, wrap it in a div with overflow-x: auto and ensure table headers remain clear. This avoids layout breaks on narrow screens.
Code Solution
SolutionRead Only
<div style="overflow-x:auto;"> <table> <tr><th>Name</th><th>Email</th><th>Role</th></tr> <tr><td>John</td><td>john@example.com</td><td>Admin</td></tr> </table> </div>
Practice Sets
This question appears in the following practice sets:
