Challenge - 5 Problems
Odd and Even Row Styling Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ selector
intermediate2:00remaining
Identify the correct Tailwind class for odd row background
Which Tailwind CSS class applies a background color only to odd rows in a table?
Tailwind
<table class="table-auto w-full"> <tbody> <tr class="?"> <td>Row 1</td> </tr> <tr> <td>Row 2</td> </tr> </tbody> </table>
Attempts:
2 left
💡 Hint
Tailwind uses the keyword 'odd' to target odd-numbered rows.
✗ Incorrect
The class 'odd:bg-gray-100' applies the gray background only to odd rows. 'even:bg-gray-100' targets even rows. Other options are invalid Tailwind syntax.
❓ layout
intermediate1:30remaining
Effect of odd and even row styling on table readability
Why is applying different background colors to odd and even rows helpful in tables?
Attempts:
2 left
💡 Hint
Think about how your eyes follow lines in a list.
✗ Incorrect
Alternating row colors help users track data across the row easily, improving readability. It does not affect loading speed, font size, or visibility.
📝 Syntax
advanced2:00remaining
Identify the invalid Tailwind class for even row styling
Which of these Tailwind classes will NOT correctly apply a background color to even rows?
Attempts:
2 left
💡 Hint
Tailwind uses dashes to separate color names and numbers.
✗ Incorrect
Option A is invalid because 'blue200' lacks the dash between 'blue' and '200'. Tailwind requires the dash for color shades. Other options are valid classes.
❓ rendering
advanced2:00remaining
Result of applying odd:bg-green-100 and even:bg-yellow-100 on table rows
What will you see when a table has rows styled with 'odd:bg-green-100' and 'even:bg-yellow-100' classes?
Tailwind
<table class="table-auto w-full"> <tbody> <tr class="odd:bg-green-100 even:bg-yellow-100"><td>Row 1</td></tr> <tr class="odd:bg-green-100 even:bg-yellow-100"><td>Row 2</td></tr> <tr class="odd:bg-green-100 even:bg-yellow-100"><td>Row 3</td></tr> <tr class="odd:bg-green-100 even:bg-yellow-100"><td>Row 4</td></tr> </tbody> </table>
Attempts:
2 left
💡 Hint
Odd and even classes apply different styles to different rows.
✗ Incorrect
The 'odd:bg-green-100' applies a light green background to odd rows, and 'even:bg-yellow-100' applies a light yellow background to even rows, creating alternating colors.
❓ accessibility
expert2:30remaining
Accessibility considerations for odd and even row styling
Which practice ensures odd and even row background colors are accessible for users with color blindness?
Attempts:
2 left
💡 Hint
Think about how people with different vision perceive colors.
✗ Incorrect
Good accessibility means using colors with enough contrast and adding other visual cues like borders or patterns so everyone can distinguish rows, including those with color blindness.