Try to keep your styling separate from behaviours. CSS: tbody td { text-align: center } tbody td.first { border-left: 3px solid #EEE; text-align:left } tbody td.last { border-right: 3px solid #EEE; text-align:right }
JS: $('#table tbody td') .filter(':first').addClass('first').end() .filter(':last').addClass('last').end(); Ideally you would do this with CSS only (:first-child and :last-child are supported in all browsers > IE6): tbody td { text-align: center } tbody td:first-child { border-left: 3px solid #EEE; text-align:left } tbody td:last-child { border-right: 3px solid #EEE; text-align:right } On Jul 14, 8:31 am, Alexandru Adrian Dinulescu <alex.d.a...@gmail.com> wrote: > Hello. > > I am trying to do > $("tbody tr").each(function(){ > $(this).children("td:first").css({ > 'border-left': '3px solid #EEEEEE', > }); > $(this).children("td:last").css({ > 'border-right': '3px solid #eeeeee', > }); > $(this).children("td:not(:first:last)").css("text-align", > "center"); > }); > > This works in Firefox 3.5 but somehow it bogs down in IE7+ > I also tried with td:eq(0) and td:eq(4) (have 5 columns) > > help? > > ------------------- > Alexandru Dinulescu > Web Developer > (X)HTML/CSS Specialist > Expert Guarantee Certified Developer > XHTML:http://www.expertrating.com/transcript.asp?transcriptid=1879053 > CSS :http://www.expertrating.com/transcript.asp?transcriptid=1870619 > RentACoder > Profile:http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInf... > > XHTML/CSS/jQuery Blog ->http://alexd.adore.ro/blog > MainWebsite:http://alexd.adore.ro