Find last td without using Jquery
问题 I need to find the Last td of every row in a HTML table, and remove a css from that td. Can I do it without using Jquery. How? 回答1: You can use css3 last-child property for this. Write like this: tr td:last-child{ color:red; } But it's not work in IE8 & below. 回答2: Use CSS td:last-child: { //your style here } Docs on CSS3 selectors here or using traverse the DOM using JavaScript : var mytable = document.getElementById('tableid'); var myrows = mytable.getElementsByTagName("tr"); var lastrow =