0
0
Tailwindmarkup~20 mins

Odd and even row styling in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Odd and Even Row Styling Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
2: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>
Arow-odd:bg-gray-100
Bodd:bg-gray-100
Cbg-odd-gray-100
Deven:bg-gray-100
Attempts:
2 left
💡 Hint
Tailwind uses the keyword 'odd' to target odd-numbered rows.
layout
intermediate
1: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?
AIt improves readability by visually separating rows.
BIt makes the table load faster in browsers.
CIt changes the font size of the table text.
DIt hides even rows from view.
Attempts:
2 left
💡 Hint
Think about how your eyes follow lines in a list.
📝 Syntax
advanced
2: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?
Aeven:bg-blue200
Bodd:bg-blue-200
Ceven:bg-blue-300
Deven:bg-blue-200
Attempts:
2 left
💡 Hint
Tailwind uses dashes to separate color names and numbers.
rendering
advanced
2: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>
AAll rows have a light green background.
BAll rows have a light yellow background.
CNo background colors are applied to any rows.
DOdd rows have a light green background; even rows have a light yellow background.
Attempts:
2 left
💡 Hint
Odd and even classes apply different styles to different rows.
accessibility
expert
2: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?
AUse only red and green colors for odd and even rows.
BUse very light colors that are barely visible to avoid distraction.
CUse colors with sufficient contrast and combine with other cues like borders or stripes.
DAvoid any background colors and rely only on text color changes.
Attempts:
2 left
💡 Hint
Think about how people with different vision perceive colors.