Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 552 Bytes

setting_even_rows.md

File metadata and controls

25 lines (20 loc) · 552 Bytes

Giving a background color to rows in a table

Sometimes you want to make the table stand out in terms of giving each other (even) row a different background color.

We can do this by extending out TailWind CSS file like so

module.exports = {
  content: ['./src/**/*.{js,jsx,ts,tsx}'],
  theme: {
    container: true,
    extend: {
      backgroundColor: ['even'], //  <--- here
    },
  },
  plugins: [],
};

With the addiontion of ['even'] we can use this like so for background colors

<tr class="even:bg-blue-100">
    ...