Agyan
adda
Run
Reset
Copy
CSS Tutorial › CSS Tables › Striped table with hover
Back to tutorial
Code
Edit, then press Run or Ctrl+Enter
<style> .wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-family: Arial, sans-serif; } th, td { border: 1px solid #ddd; padding: 10px; text-align: left; } th { background: #1f386b; color: white; } tr:nth-child(even) { background: #f4f7fc; } tr:hover { background: #fff3cd; } </style> <div class="wrap"> <table> <tr><th>Course</th><th>Topics</th><th>Level</th></tr> <tr><td>HTML</td><td>33</td><td>Beginner</td></tr> <tr><td>CSS</td><td>38</td><td>Beginner</td></tr> <tr><td>JavaScript</td><td>40</td><td>Intermediate</td></tr> </table> </div>
Result