severndigital Posted August 11, 2009 Share Posted August 11, 2009 I want to put borders around the table cells on this table using css. <table name="purgeTable" id="purgeTable" /> <thead> <th >Job Num</th> <th >Customer</th> <th >Job Name</th> </thead> <tbody> <tr> <td >172860r</td> <td >Guitar Solo</td> <td >Bellinati:valsa Brilhante</td> </tr> <tr> <td >176430</td> <td >Wayne Leupold</td> <td >Organist's Companion-july</td> </tr> </tbody> </table> if i remove the thead and tbody tags I can set the borders of the table and the cells. how do i control the border of the cells, rows, and headers when i am using the thead and tbody tags? I've looked a bunch of online examples, but can't seem to get this working correctly. here is my css #purgeTable table, td { border-color: #600; border-style: solid; } #purgeTable table { border-width: 0 0 1px 1px; border-spacing: 0; border-collapse: collapse; } #purgeTable td { margin: 0; padding: 4px; border-width: 1px 1px 0 0; background-color: #FFC; } I'm very confused now, i've been coding in circles for about an hour. please help Thanks Quote Link to comment Share on other sites More sharing options...
sawade Posted August 11, 2009 Share Posted August 11, 2009 <table name="purgeTable" id="purgeTable" /> remove the / <table name="purgeTable" id="purgeTable"> May not solve the problem, but remember the table element is not empty. You have a closing tag later </table> Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted August 12, 2009 Share Posted August 12, 2009 table thead th { style border.... } table tbody td { style border... } ... you get the idea. This is called a descendant css selector. Learn it. Memorize it. Pray to it. It is the holy grail of css styling. Quote Link to comment Share on other sites More sharing options...
severndigital Posted August 12, 2009 Author Share Posted August 12, 2009 thanks to both. I just got myself at turned around and dizzy. both posts were help. -P Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.