开发者

How to select first and last <th> only?

My table has id="mytable". I'm tr开发者_运维问答ying to apply some CSS on the first and last <th> only. I tried this but it doesn't work.

#mytable th:first,
#mytable th:last{
 //css goes here
}


#mytable th:last-child, #mytable th:first-child {
 //css goes here
}


For CSS

#myTable thead tr th:first,
#myTable thead tr th:last{
  /*CSS goes here*/
}

Using Jquery (for last child only):

$("#mytable th:last-child").css({

/*CSS goes here*/

});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜