How to alternate row background color (like, grey and white)?

How to alternate row background color (like, grey and white)?

don2don2 Posts: 27Questions: 15Answers: 0

Hi All,

How to alternate row background color (like, grey and white)?

any help appreciated.
thank you so much in advance

regards
Don

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    That's the default behaviour, please see here. Other examples show more styling options, plus this section of the manual should help.

    Colin

  • zzpennzzpenn Posts: 4Questions: 1Answers: 0

    Colin, looking at the example for Stripe today, no striping is apparent even in the sample table. What needs to be done to add striping? I am expecting that striping means that alternate rows will have a different color. Is this not the expected behavior?

    https://datatables.net/examples/styling/stripe.html

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954

    The rows do have different background colors; they are light grey and white. This can be seen in your screenshot. Are you looking for something different?

    Kevin

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Yes, I can see them as well. It is possible @zzpenn that you are using a monitor that doesn't show light greys very well. Try changing the angle that you are looking at the monitor from - for example if you look at it from where your keyboard is, I'd guess that you'll be able to see the row stripes.

    Allan

  • zzpennzzpenn Posts: 4Questions: 1Answers: 0
    edited December 2022

    Thank you! Yes it was the monitor. I will need to change the style of striping to account for this. All of my users have the same monitor I'm using, so they won't see it either. For future readers, a style change example is here:
    http://live.datatables.net/welezolo/1/edit

Sign In or Register to comment.