How to use nth-child for styling with a table with rowspan?

后端 未结 6 1969
盖世英雄少女心
盖世英雄少女心 2020-12-01 17:37

I have a table that has one row that uses rowspan. So,

6条回答
  •  春和景丽
    2020-12-01 18:25

    I used a combination of previous answer to add tr's with display=none programatically:

    HTML

      
.........
A B C
1 2 sub C 1
sub C 2
3 4 5
6 7 8

CSS

table tr:nth-child(2n) {
  background-color: #F8ECE0;
}

JQUERY

$( "" ).insertAfter('tbody tr:has(td[rowspan])');

See the JSfiddle.

提交回复
热议问题