This is a more practical function. After setting the odd and even rows to different colors, the experience of reading table data will obviously become better. Otherwise, the data will appear very complicated and crowded (the experience will be especially obvious when there are many rows of table data). Only when you actually do something in this area will you have a strong experience. Anyway, I just experienced it, so leave it here for reference~
The core JS script code is as follows (the id of the table element is based on Adjust according to your own situation. The jquery-1.7.min.js in the code can be downloaded from jquery’s official website)