in jquery:
$ (' Table Tr:even ')-> means to get all rows with an even number of indexes for a table, where index indices start at 0 and 0 are even.
$ (' Table tr:odd ')-> means to get all the odd rows indexed by a table, where index indices start at 0 and 0 are odd.
Eg:
Create a table with 6 rows of data, make the background color green for odd rows, the font color of even rows is red, the code is as follows:
1. Import jquery.
2. Create a table.
3. Write a script.
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<script type= "Text/javascript" src= "Js/jquery.min.js" ></script>
<body>
<table border= "1px" cellspacing= "0" cellpadding= "ten" >
<tr><td>AA</td><td>BB</td><td>CC</td></tr>
<tr><td>AA</td><td>BB</td><td>CC</td></tr>
<tr><td>AA</td><td>BB</td><td>CC</td></tr>
<tr><td>AA</td><td>BB</td><td>CC</td></tr>
<tr><td>AA</td><td>BB</td><td>CC</td></tr>
<tr><td>AA</td><td>BB</td><td>CC</td></tr>
</table>
<script type= "Text/javascript" >
$ ("Table Tr:even"). CSS ("Background-color", "green");
$ ("Table Tr:odd"). CSS ("Color", "red");
</script>
</body>