Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Set different colors for alternate rows of a table.

Easy

Problem Statement

Set different colors for alternate rows of a table.

Sample Input

A webpage with a <table> element.

Sample Output

The alternate rows of the table have different background colors.

Limits

Time: 2s · Memory: 256 MB

Code Editor

Try your code in this preview. Submit marks it done.

<!DOCTYPE html> <html> <head> <style> /* Add CSS here to style the table */ </style> </head> <body> <table> <tr><td>Row 1</td></tr> <tr><td>Row 2</td></tr> <tr><td>Row 3</td></tr> <tr><td>Row 4</td></tr> </table> </body> </html>

Document

To view the HTML changes, please type the code within the editor