Tag: 突出显示已

jQuery仅在表格中突出显示所选列

我看到这篇文章突出显示偶数列,但我是否可以仅突出显示所选列? 这是他们使用的代码: $(“table.Table22 > tbody > tr > td:nth-child(even)”).css(“background”,”blue”); 但我想:注意: class=”highlight”将在所选列上,所以如果我选择了第3列,则class=”highlight”将从第2列中删除并添加到第3列.jQuery需要添加类基于选定的列。 Cell 1:Heading Selected column so this should be highlighted Cell 3:Heading Cell 4:Heading Cell 5:Heading Cell 1:Row 1 Selected column so this should be highlighted Cell 3:Row 1 Cell 4:Row 1 Cell 5:Row 1 Cell 1:Row 2 Selected column so this should be highlighted […]