Table Striping not working
Table Striping not working
jswaringen
Posts: 4Questions: 2Answers: 0
I'm trying to get the table striping. I've setup the various class but it doesn't work. I also noticed that it doesn't work in the example code provided in the documentation. Since I am not using Bootstrap so it's being difficult?
This discussion has been closed.
Answers
Hi jswaringen,
The striping in the example base-style stripe is working on IE11 and FF 47 with me. A very light grey is used and on some monitors it's hardly noticeable.
Can you check if you used the class stripe in your table tag?
I believe I'm using it the correct way. Here's what I have.
Here's my table code:
And here's my CSS:
This is the JavaScript:
If you are including the DataTables stylesheet then the above style won't be shown because DataTables' own styling for the row background uses a more specific selector than your own. If you make the selector at least as specific it works: http://live.datatables.net/welezolo/1/edit .
The MDN article on this topic is a good introduction if you are interested in learning more.
Allan
I followed the example at your link, and when I run it I see my row has class of stripe1/stripe2, but the background is still white. I'm using jqueryui theme though, does that change things?
I'd suggest right clicking on a cell in your table and select "Inspect". Then look in the "Styles" part of the inspector and it will show you what styles are overriding your own.
Allan