Support striped rows in tables
See original GitHub issueWhat problem does this feature solve?
When you have a lot of data in a table, it’s easy to skip between rows while reading across the line, so lots of places colour every other row (or every nth row) to make it clearer. Here are [some examples](https://www.google.com/search?tbm=isch&q=striped table rows).
What does the proposed API look like?
Perhaps a new string property on the Table API to allow every nth row to be striped using the same selectors as the CSS nth-child selectors:
stripes=even
- use the stripe colour for rows 2, 4, 6, …stripes=odd
- use the stripe colour for rows 1, 3, 5, …stripes=4
- use the stripe colour on row 4stripes=4n
- use the stripe colour on every fourth row: 4, 8, 12, …stripes=4n 2
- use the stripe colour on every fourth row, starting with the second row: 2, 6, 10, …stripes=-n 2
- use the stripe colour on the first two rows: 1, 2
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How To Create A Zebra Striped Table - W3Schools
To create a zebra-striped table, use the nth-child() selector and add a background-color to all even (or odd) table rows: ...
Read more >Zebra-striping rows and columns - CSS Wizardry
Striping a table's alternate rows couldn't be simpler. By programatically adding a class of odd or suchlike to every other <tr> you can...
Read more >Zebra Striping: Does it Really Help? - A List Apart
Zebra striping —also known as candy striping or half-shadow—is the application of faint shading to alternate lines or rows in data tables or...
Read more >Tables - Bootstrap
Tables · Examples · Table head options · Striped rows · Bordered table · Hoverable rows · Small table · Contextual classes ·...
Read more >Alter bootstrap's table striped Rows to be every other couple ...
I'd like to modify bootstrap ever so slightly so that my striped rows are as such. Row 1 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the proposed is useful
I found two ways to do this as of now:
One way is to use
rowClassName
prop of Table:Second way is to use plain CSS
Note that rowClassName works only for rows, so for CSS on table headers we can only use plain CSS like above.