Just use some css, it’ll apply it automatically:
.your_table tr:nth-child(odd) { background-color:#00000; }
.your_table tr:nth-child(even) { background-color:#ffffff; }
1
solved How can I add more than just one class to table rows in PHP? [closed]