Jump to content

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/234055-w3c-compliant-but-lost-table-boarders/
Share on other sites

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;
}

 

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.

 

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.

.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;
}

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;
}

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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.