我创建了一个非常简单的代码,以便直观地清楚如何从同一页面上其他用户的响应中选择列或行。
https://codepen.io/luis7lobo9b/pen/XWaNYXz
<!doctype html>
<html lang="pt-br">
<head>
<!-- https://stackoverflow.com/questions/15639247/css-selector-for-nth-range -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, user-scalable=yes, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
table{margin: 50px auto;}
thead tr{background-color: gray; font-weight: 700;}
td{border: 1px solid black;padding: 2px 8px;}
table tr:nth-child(n+2):nth-child(-n+3){background-color:blue;}
table td:nth-child(n+2):nth-child(-n+3){background-color:red;}
</style>
</head>
<body>
<table>
<thead>
<tr>
<td>AAA</td>
<td>BBB</td>
<td>CCC</td>
<td>DDD</td>
<td>EEE</td>
<td>FFF</td>
</tr>
</thead>
<tbody>
<tr>
<td>111</td>
<td>111</td>
<td>111</td>
<td>111</td>
<td>111</td>
<td>111</td>
</tr>
<tr>
<td>222</td>
<td>222</td>
<td>222</td>
<td>222</td>
<td>222</td>
<td>222</td>
</tr>
<tr>
<td>333</td>
<td>333</td>
<td>333</td>
<td>333</td>
<td>333</td>
<td>333</td>
</tr>
<tr>
<td>444</td>
<td>444</td>
<td>444</td>
<td>444</td>
<td>444</td>
<td>444</td>
</tr>
<tr>
<td>555</td>
<td>555</td>
<td>555</td>
<td>555</td>
<td>555</td>
<td>555</td>
</tr>
</tbody>
</table>
</body>
</html>