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 Link to comment https://forums.phpfreaks.com/topic/169824-solved-simple-table-problem-cant-put-my-finger-on-it/ 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> Link to comment https://forums.phpfreaks.com/topic/169824-solved-simple-table-problem-cant-put-my-finger-on-it/#findComment-896063 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. Link to comment https://forums.phpfreaks.com/topic/169824-solved-simple-table-problem-cant-put-my-finger-on-it/#findComment-896095 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 Link to comment https://forums.phpfreaks.com/topic/169824-solved-simple-table-problem-cant-put-my-finger-on-it/#findComment-896369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.