otuatail Posted April 18, 2011 Share Posted April 18, 2011 Hi I have spent some time making my pages W3C compliant, but now I dont have a border on my table and cell spacing does not work. Any ideas on this please <table style="border-collapse:collapse;cellpadding:5;width:800;align:left;border:1px;"> http://www.des-otoole.co.uk/streetangels/News/Threads.php TIA Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/ Share on other sites More sharing options...
cssfreakie Posted April 18, 2011 Share Posted April 18, 2011 first of all don't use inline style it's redundant certainly on tables, and it's very likely you miss some property. So remove the inline style of your table and add in your externalstylesheet table{ border: 1px solid red; /* you had just border: 1px; */ border-collapse: collapse; } td{ border:1px solid #999; } Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203022 Share on other sites More sharing options...
otuatail Posted April 18, 2011 Author Share Posted April 18, 2011 Hi I will move this over to the style sheet later. Din;t realise that all this change was neede. I have made your sugestions but they don't work. Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203031 Share on other sites More sharing options...
cssfreakie Posted April 18, 2011 Share Posted April 18, 2011 I did it in my browser with firebug and it worked, so you might have forgotten something like removing inline style. In the end inline style overwrites all your efforts from a external stylesheet. So start with a clean slate, remove inline style and add it to an external stylesheet. Also if something doesn't work it's fastest to check it out in something like firebug. You can directly see where it get's it's style from. made a short video on my bloag abut it, if your not familiar with firebug, it might be nice to check it out. Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203035 Share on other sites More sharing options...
cssfreakie Posted April 18, 2011 Share Posted April 18, 2011 I did it in my browser with firebug and it worked, so you might have forgotten something like removing inline style. In the end inline style overwrites all your efforts from a external stylesheet. So start with a clean slate, remove inline style and add it to an external stylesheet. Also if something doesn't work it's fastest to check it out in something like firebug. You can directly see where it get's it's style from. made a short video on my bloag abut it, if your not familiar with firebug, it might be nice to check it out. don't pay attention to my spelling video here if needed. Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203044 Share on other sites More sharing options...
otuatail Posted April 18, 2011 Author Share Posted April 18, 2011 No I have done all that checked it out in IE and FF. I have .TableClass { border:20px; font-weight:bold; solid:red;; } and <table class="TableClass"> Align and font-weight work only Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203055 Share on other sites More sharing options...
cssfreakie Posted April 18, 2011 Share Posted April 18, 2011 .TableClass { border:20px; font-weight:bold; solid:red;; /* this is wrong also extra semilcolon*/ } declare the border as: border:1px solid red; so that would become .TableClass{ border:1px solid red; } Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203064 Share on other sites More sharing options...
otuatail Posted April 18, 2011 Author Share Posted April 18, 2011 Ok now I only have the table border red. The old method of border"2" affected the entire table. Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203069 Share on other sites More sharing options...
cssfreakie Posted April 18, 2011 Share Posted April 18, 2011 Ok now I only have the table border red. The old method of border"2" affected the entire table. yes? and now you ask implicitly how to set a border to all stuff? If that is the case have a read here. http://www.w3.org/TR/html4/struct/tables.html A table consists of more elements (th td tr tbody) than only the wrapper <table>. so if i want all td's pink i do td{ background: #f4a; } Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203077 Share on other sites More sharing options...
otuatail Posted April 18, 2011 Author Share Posted April 18, 2011 ttp://www.w3.org/TR/html4/struct/tables.html is out dated <table border="1"> no longer supported Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203094 Share on other sites More sharing options...
otuatail Posted April 18, 2011 Author Share Posted April 18, 2011 NOW I find that if a table row has a background colour the boarder dissapears. Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203113 Share on other sites More sharing options...
cssfreakie Posted April 18, 2011 Share Posted April 18, 2011 NOW I find that if a table row has a background colour the boarder dissapears. read the manual, it's all in there! as far as your comment on the deprecated stuff, which it is (that's another reason to separate style from content) Quote Link to comment https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/#findComment-1203119 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.