Materialize css


#1

Hi,

I’m using a dynamic table (https://puravidaapps.com/table.php)
With the HTML doc, I find how to change the table form from Materializecss.com (stripered or bordered …) at the line :

    doc.getElementById("myTable").getElementsByTagName('table')[0].className = "bordered";

But I don’t know how to change the differents colors. Where do I have to write “card-panel teal lighten-2” if I want to change the background color for 1 line over 2 ?

Thank you


#2

No body has an idea?


#3

you probably will have more luck asking this question in a materializecss forum…
Taifun


#4

To help everyone :
That was only css problem!
In the html file you should add in the header : <style> </style>

Inside it you can add everything you want to do to your table
Fontsize, padding, text-align, border… (you can find everything on google)

If you write th => it means the first line of the table
and td => everything else

If you want to change the color of one line over two just add:
tr:nth-child(even) {background-color: #f2f2f2}

Hope that can help… I didn’t success for a long… but now it’s OK!!!