I have a table where I have set the tr style to:
border-bottom:1px silver solid;
The table is database generated, and I don’t want the last tr to have the bottom border.
How to I stop the last tr from getting the styling?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can select the last
trusing javascript or CSS, but if you choose to do it with CSS it won’t work on all browsers (nor will the JS solution on browsers that don’t have JS enabled).jQuery:
or if multiple instances:
The CSS solution would be to just use:
Note that the
:lastselector selects only one instance, and as it isn’t part of the CSS specification, it isn’t quite as fast aslast-childselector, but that selection may not be what you are looking for if you have nested tables etc.