Forum Moderators: open

Message Too Old, No Replies

Border color in HTML 4.01 Transitional?

         

palmpal

3:24 pm on Jul 5, 2003 (gmt 0)

10+ Year Member



Hello,

Can someone tell me if it is possible to set a border color for a table in HTML 4.01 Transitional? I'm getting an error when I validate it and can't find anything on the W3C website.

Thanks!

killroy

3:30 pm on Jul 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use CSS

<table style="border:2px solid red">

can you paste the error perhaps?

SN

palmpal

3:49 pm on Jul 5, 2003 (gmt 0)

10+ Year Member



Hello,

Thanks for the reply. Since this is the only table on my site that has a colored border I decided against putting it in the CSS. But your comment got me to thinking and after examining my CSS I was able to identify my error. I needed a dash between border and color and a semi-colon between the attributes. Also, I discovered you can only specify the style one time! Here is my fixup:

<table CLASS="scpbody3" border="3" cellspacing="1" style="border-collapse: collapse; border-color: BA969A" width="100%">

Reminder to All: Check your W3C validation! I made some minor changes to my site a few weeks ago and just got around to checking my validation today. To my surprise I had eight pages that didn't validate. Most were minor fixes. Note to self: Check validation regularly!

Marcia

4:01 pm on Jul 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got some pages that validate except for that same one thing.

I don't want the same border to show on all tables, since I use tables to be able to do "modular" type page design and just plug segments of code into pages.

Some of the tables are for placement of small blocks of data, such as in left or right navigation columns, but on some ecom sites there needs to be a very light colored border around the tables used for product display to set each one off for clarity.

That'll mean using classes - divs or spans; I'm not sure which way to go with coding those, since it'll need to be in linked stylesheets. It has to go in the stylesheet because the same type of code gets plugged in repeatedly and some stylesheets are used as templates, modified as needed for different sites.

[edited by: Marcia at 4:03 pm (utc) on July 5, 2003]

killroy

4:03 pm on Jul 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm, might be an idea for a tool. Spider your own site, run pages through validator, create summary sheets pointing out number and types of errors for all pages.

Hmm I guess due to server load it'd be against hte w3c validator TOS though.

SN

g1smd

7:03 pm on Jul 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Umm, just put a small link like:

<a href="http://validator.w3.org/check/referer" target="_blank">Test</a>

on every page of the site, even better to use an include for that.

Or, else build up a "secret" page on the site with links like this, one for every page of the site:

<a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.mysite.com%2Ffolder%2Ffilename.html&amp;charset=%28
detect+automatically%29&amp;doctype=%28detect+automatically%29&amp;ss=1&amp;outline=1&amp;sp=1&amp;verbose=1" target="_blank">filename.html</a>

that allows you to check each page one at a time.

Use: <meta name="robots" content="noindex,nofollow"> on that page to hide it from search engines.

Note that the encoded characters are as follows %3A is : and %2F is / and %28 is [ and %29 is ] in the long URL.

.

[edited by: g1smd at 7:33 pm (utc) on July 5, 2003]

tedster

7:27 pm on Jul 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since this is the only table on my site that has a colored border I decided against putting it in the CSS.

You can use killroy's code inline in your HTML -- no need to put it anywhere except right in the one table tag where you need it. That's the beauty of "cascading" style sheets.