Reputation: 4095
I want to apply right alignment for all the columns except for the first column.
I wrote the following, but which is working fine. But how can i combine these to statements in to one line.
$("table.ftable tr:gt(0)").css("text-align", "right");
$("table.ftable td:first-child").css("text-align", "left");
Any Ideas..?
Upvotes: 1
Views: 361
Reputation: 1177
try using CSS in a style sheet. avoid js to css at all costs if you can!.. an accumulation of these will make your app slower.
table td {
text-align:right;
}
table tr td:first-child {
text-align: left !important;
}
http://www.w3schools.com/cssref/sel_firstchild.asp
Upvotes: 3