473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

What's the CSS equivalent of <table bordercolor="#ffffff"> ?

Hello,

I am updating some old web pages, and have come across a problem. I have
some tables where the opening tag looks like...

<table border="1" bordercolor="#ffffff">

which gives a nice flat border around the table in IE, and a fairly
unpleasant (IMO) 3D-effect border in Firefox.

I am trying to achieve the same effect as I see in IE, but in CSS
instead of in HTML, but can't reproduce the same border. I tried
creating a class like...

..flatborder {
border: 1px;
border-color: #000000;
border-style: solid;
}

But this gave the same 3D-effect that I had in Firefox.

Is there a way to use CSS to get IE and FF to show the nice flat border
that IE gives with the bordercolor attribute? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 31 '06 #1
22 12937
Els
Alan Silver wrote:
I am updating some old web pages, and have come across a problem. I have
some tables where the opening tag looks like...

<table border="1" bordercolor="#ffffff">

which gives a nice flat border around the table in IE, and a fairly
unpleasant (IMO) 3D-effect border in Firefox.

I am trying to achieve the same effect as I see in IE, but in CSS
instead of in HTML, but can't reproduce the same border. I tried
creating a class like...

.flatborder {
border: 1px;
Make that border-width:1px;
border-color: #000000;
border-style: solid;
}

But this gave the same 3D-effect that I had in Firefox.
Does it still do that with border-width instead of border?
Is there a way to use CSS to get IE and FF to show the nice flat border
that IE gives with the bordercolor attribute? TIA


I've never seen 3D borders when stating border-style:solid;

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: King Crimson - Lizard
Jan 31 '06 #2
Alan Silver <al*********@nospam.thanx.invalid> wrote:
.flatborder {


That applies to an element in class "flatborder". You have not
specified any markup that contains any class attribute.

The odds are that you are applying something to a <table> element when
you would in fact need to apply it to table cells as well.

Hint: specify the URL. It saves a lot of everyone's time, and you know,
everyone is busy.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jan 31 '06 #3
>> .flatborder {

That applies to an element in class "flatborder". You have not
specified any markup that contains any class attribute.
Nope, I showed the HTML that I had without any CSS. This class was an
example of the sort of thing I wanted to do. I assumed it was fairly
obvious that it was to apply to the <table> tag as that was the only tag
I showed.

Sorry if I wasn't clear.
The odds are that you are applying something to a <table> element when
you would in fact need to apply it to table cells as well.
Well, if I understand correctly, the border is part of the table, rather
than the cell. Going on the way HTML attributes work, "border" and
"bordercolor" (now obsolete) both went on the <table> tag to produce the
effect I described.
Hint: specify the URL. It saves a lot of everyone's time, and you know,
everyone is busy.


I know, that's why the post was short and (hopefully) to the point. I
don't have an URL for this site, and as the HTML/CSS in question was so
short, I didn't see any need to create a sample page and find somewhere
free to upload it just for this.

Obviously I would provide an URL for something more complex.

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 31 '06 #4
<snip>
.flatborder {
border: 1px;


Make that border-width:1px;


Aha, that made a difference!! Thanks for spotting that.
border-color: #000000;
border-style: solid;
}

But this gave the same 3D-effect that I had in Firefox.


Does it still do that with border-width instead of border?


Nope, it gives a nice flat border like I wanted.

The only thing is that this only gives a border around the extremities
of the table. Specifying the bordercolor attribute on the <table> tag
put the border around each cell as well.

I tried adding the following three lines to the class that is used to
style each table cell...

border-width:2px;
border-color: #63B7E5;
border-style: solid;

but it didn't do anything. Any idea how to get the inner lines showing
as well?
Is there a way to use CSS to get IE and FF to show the nice flat border
that IE gives with the bordercolor attribute? TIA


I've never seen 3D borders when stating border-style:solid;


Try the HTML I originally posted. In FF (at least, in version 1.5), the
table has a border that looks to me like it's supposed to be 3D. If you
look closely, the inner and outer edges of the border are different
colours. At any rate, it isn't a simple flat line like IE shows.

Thanks for the reply. Any further help appreciated.

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 31 '06 #5
Els
Alan Silver wrote:

[border on table using css]
.flatborder {
border: 1px;
Make that border-width:1px;


Aha, that made a difference!! Thanks for spotting that.


[snip]
The only thing is that this only gives a border around the extremities
of the table. Specifying the bordercolor attribute on the <table> tag
put the border around each cell as well.

I tried adding the following three lines to the class that is used to
style each table cell...
How? You didn't add 'class="classname"' to each and every cell? No
need :-)

..flatborder td{
border:2px solid #63B7E5;
}
Is there a way to use CSS to get IE and FF to show the nice flat border
that IE gives with the bordercolor attribute? TIA


I've never seen 3D borders when stating border-style:solid;


Try the HTML I originally posted. In FF (at least, in version 1.5), the
table has a border that looks to me like it's supposed to be 3D.


That was with faulty CSS, right? ;-)
It might well be that the default border style in FF is 'outset'
instead of 'solid'. With correctly written CSS and border-style:solid;
FF won't give that effect afaik.
Thanks for the reply. Any further help appreciated.


You're welcome :-)

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: King Crimson - Fracture
Jan 31 '06 #6
Alan Silver <al*********@nospam.thanx.invalid> wrote:
I didn't see any need to create a sample page and find somewhere
free to upload it just for this.


Too bad. You are not helping us to help you.

And your understanding of borders in HTML vs. CSS _is_ apparently
wrong.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jan 31 '06 #7
>And your understanding of borders in HTML vs. CSS _is_ apparently
wrong.


That's why I came here, to be educated by those who know, and are
prepared to help. I have had help, and am now better educated. There's
still plenty I need to learn, but I am further on than I was before.

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 31 '06 #8
<snip>
I tried adding the following three lines to the class that is used to
style each table cell...


How? You didn't add 'class="classname"' to each and every cell?


No, I already had a class on every cell to set the background colour. I
just added those lines to the one class definition.

<snip>
Try the HTML I originally posted. In FF (at least, in version 1.5), the
table has a border that looks to me like it's supposed to be 3D.


That was with faulty CSS, right? ;-)


No, that was without any CSS. The original HTML (typed from memory as I
can't be bothered checking what I really typed) looked like...

<table border="1" bordercolor="#000000">

Anyway, it seems to work now, except for the problem I mentioned with
the inner cell borders.

Ta ra

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 31 '06 #9
Els
Alan Silver wrote:
<snip>
I tried adding the following three lines to the class that is used to
style each table cell...
How? You didn't add 'class="classname"' to each and every cell?


No, I already had a class on every cell to set the background colour. I
just added those lines to the one class definition.


Okay, so.. why aren't you having borders on the cells yet then?
td.class{
border:2px solid #63B7E5;
}
should just work.
<snip>
Try the HTML I originally posted. In FF (at least, in version 1.5), the
table has a border that looks to me like it's supposed to be 3D.
That was with faulty CSS, right? ;-)


No, that was without any CSS. The original HTML (typed from memory as I
can't be bothered checking what I really typed) looked like...

<table border="1" bordercolor="#000000">


Understood.
I've never used that type of code myself, so that would explain why I
never saw it make 3D borders in FF ;-)
Anyway, it seems to work now, except for the problem I mentioned with
the inner cell borders.


Can you show exactly what styles you used for the cells, including the
selector and class, as well as a snippet from the HTML, including
table, tr and td?

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: King Crimson - Vrooom Vrooom
Jan 31 '06 #10
>> Anyway, it seems to work now, except for the problem I mentioned with
the inner cell borders.


Can you show exactly what styles you used for the cells, including the
selector and class, as well as a snippet from the HTML, including table, tr
and td?


OK, here is a complete page showing the problem. I realised whilst
making it that I am still using cellpadding and cellspacing on the
<table> tag. I'm not sure what the CSS equivalents of these are. I don't
think it affects the issue, but if you can tell me what they are it
would help shift more presentation out of the HTML and into the CSS.

Here is the code. Thanks again for all the help.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test</title>
<style type="text/css">
..DapTable {
width: 100%;
border-width:2px;
border-color: #63B7E5;
border-style: solid;

}
..tableCell {
background-color: #eeeeff;
text-align: left;
vertical-align: top;
border: 2px solid #63B7E5;
}
</style>
</head>

<body>
<table cellpadding="6" cellspacing="0" class="DapTable">
<tr class="tableCell">
<td>this is some stuff</td>
<td>hello world</td>
</tr>
<tr class="tableCell">
<td>I was here</td>
<td>some pig!!</td>
</tr>
</table>
</body>
</html>

--
Alan Silver
(anything added below this line is nothing to do with me)
Jan 31 '06 #11
Els
Alan Silver wrote:
OK, here is a complete page showing the problem. I realised whilst
making it that I am still using cellpadding and cellspacing on the
<table> tag. I'm not sure what the CSS equivalents of these are.
cellpadding:
td{
padding:5px;
}

cellspacing:
table{
border-collapse:collapse;
}
Here is the code. Thanks again for all the help.
[snip] .tableCell { [snip styles] }
[snip]
<tr class="tableCell">
<td>this is some stuff</td>


As you can see, you set the class on the TR, not the TD.
A small change to your CSS makes up for that:
..tableCell td{
[styles]
}

".tableCell td" is a selector for a td that is a descendent of an
element with class 'tableCell'.
You could also write ".DapTable td", since you want the style applied
to all the TDs in that table.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Jan 31 '06 #12
And you thought that you could ask a question here and receive patient
understanding and helpful guidance rather than ridicule about your
ignorance? That, my naive friend, is _not_ the way it works in
Finland.

Yucky, http://www.yuckykorpulent.com

Feb 1 '06 #13
Alan Silver wrote:
The odds are that you are applying something to a <table> element when
you would in fact need to apply it to table cells as well.


Well, if I understand correctly, the border is part of the table, rather
than the cell. Going on the way HTML attributes work, "border" and
"bordercolor" (now obsolete) both went on the <table> tag to produce the
effect I described.

In the tag form the border[color] is applied to both the table and its
cells. In CSS table borders and table cell borders are separate and must
be specified individually; this is actually a Good Thing.
Hint: specify the URL. It saves a lot of everyone's time, and you know,
everyone is busy.


I know, that's why the post was short and (hopefully) to the point. I
don't have an URL for this site, and as the HTML/CSS in question was so
short, I didn't see any need to create a sample page and find somewhere
free to upload it just for this.

It's easier to just provide an URL to a test case. It saves all this
blather about the scope of the problem.
In general there is more to a question than you think and having to
extract relevant info piecemeal is boring and annoying especially when you
suffer from a misunderstanding of CSS or HTML. A test case would provide
the info we need all in one package.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Feb 1 '06 #14
>And you thought that you could ask a question here and receive patient
understanding and helpful guidance rather than ridicule about your
ignorance? That, my naive friend, is _not_ the way it works in
Finland.


Good job I don't live in Finland eh?

--
Alan Silver
(anything added below this line is nothing to do with me)
Feb 1 '06 #15
>> OK, here is a complete page showing the problem. I realised whilst
making it that I am still using cellpadding and cellspacing on the
<table> tag. I'm not sure what the CSS equivalents of these are.

<snip>

That's fantastic, thanks very much.

--
Alan Silver
(anything added below this line is nothing to do with me)
Feb 1 '06 #16
>In general there is more to a question than you think and having to
extract relevant info piecemeal is boring and annoying especially when
you suffer from a misunderstanding of CSS or HTML. A test case would
provide the info we need all in one package.


Point taken. In this case it would have been better to have provided a
full sample of the code in question. It seemed such a simple issue that
I didn't see the point in making the post longer than needed.

Thanks for the clarification.

--
Alan Silver
(anything added below this line is nothing to do with me)
Feb 1 '06 #17
Alan Silver <al*********@nospam.thanx.invalid> wrote:
And you thought that you could ask a question here and receive
patient understanding and helpful guidance rather than ridicule
about your ignorance? That, my naive friend, is _not_ the way it
works in Finland.


Good job I don't live in Finland eh?


You have the privilege of babbling pointlessly, and getting ignored in
future. You already admitted you should have posted a URL, so praising
a troll was foolish. Feed the trolls, get treated like one. Hope this
helps. HAND.

(I would have sent this privately only, but you use a fake From field.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Feb 1 '06 #18
Jukka K. Korpela wrote:
You have the privilege of babbling pointlessly, and getting ignored in
future. You already admitted you should have posted a URL, so praising
a troll was foolish. Feed the trolls, get treated like one. Hope this
helps. HAND.


Now, now, Jukka... Mine is not a mission of trolldom, but rather, one
of rescue. I envision a Usenet free from the tyranny of conceited
buffoons like yourself whose first reaction is to bash newbies about
their misspellings, their misuse of technical jargon and their
nonconformity to whatever rules and regulations you and your ilk have
decreed to be the unquestionable law of Usenet.

We can do better!!!! We must do better. We must defeat bullies the
same way we defeat trolls---by ignoring them. Preface all questions
with (No Jukka!) to indicate arrogant responses from self-satisfied
clowns are not acceptable. In time, "NJ" will become a standard
tagline across Usenet, a constant reminder of how far we have come
since the days when "Clearly you have no idea what you are doing. Try
reading an introductory book on HTML" was once a common response to
well-intentioned questions. I HAVE A DREAM!!!!!!!!!!!!!!

Yucky, http://yuckykorpulent.com

Feb 1 '06 #19
>>>And you thought that you could ask a question here and receive
patient understanding and helpful guidance rather than ridicule
about your ignorance? That, my naive friend, is _not_ the way it
works in Finland.
Good job I don't live in Finland eh?


You have the privilege of babbling pointlessly,


We live in a democratic society, and I believe that is one of the
privileges ;-)
and getting ignored in
future. You already admitted you should have posted a URL, so praising
a troll was foolish. Feed the trolls, get treated like one. Hope this
helps. HAND.
I read his comment as mild humour, and replied the same way.
(I would have sent this privately only, but you use a fake From field.)


Correct. I'm fed up of spam.

--
Alan Silver
(anything added below this line is nothing to do with me)
Feb 1 '06 #20
Hello again,

Just when you thought you'd got rid of me eh? I'm back with another dumb
question about tables.

Thanks to the help I got here, I now have my tables working fine with
styles instead of inline HTML attributes. However, I've come across a
variation of the problem in that I have a nested table, and I can't
remove the styles from this!! I even have a URL this time...

http://www.kidsinaction.org.uk/Tables.html

If you look in the bottom-right cell of the main table, you see another
table. I want to remove the borders from this one. I tried this by
defining a class like this...

..NoBorders {
border-width: 0px;
border-style: none;
}

and applying it. I tried the table tag, the tr, and the td (all three in
the sample shown), but it didn't do anything. It still has the blue
borders.

I'm sure I'm doing something really stupid here. Please explain!!

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Feb 2 '06 #21
Deciding to do something for the good of humanity, Alan Silver
<al*********@nospam.thanx.invalid> declared in
comp.infosystems.www.authoring.stylesheets:
http://www.kidsinaction.org.uk/Tables.html

If you look in the bottom-right cell of the main table, you see another
table. I want to remove the borders from this one. I tried this by
defining a class like this...


Nested tables are very rarely necessary, but assuming that it is
actually semantically correct...

table.NoBorders td { border: none; }

--
Mark Parnell

I give up:
http://blinkynet.net/comp/uip5.html
Feb 2 '06 #22
>Deciding to do something for the good of humanity,

I'd like to think it helps humanity, but I doubt my incoherent waffling
is going to help many!!
Alan Silver
<al*********@nospam.thanx.invalid> declared in
comp.infosystems.www.authoring.stylesheets:
http://www.kidsinaction.org.uk/Tables.html

If you look in the bottom-right cell of the main table, you see another
table. I want to remove the borders from this one. I tried this by
defining a class like this...
Nested tables are very rarely necessary, but assuming that it is
actually semantically correct...


You care correct that they are rarely necessary, but in this case it
seems they are. I appreciate your point though. I'm not using tables for
layout!!
table.NoBorders td { border: none; }


Thanks, that worked fine.

--
Alan Silver
(anything added below this line is nothing to do with me)
Feb 5 '06 #23

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: |-|erc | last post by:
<?php // Get the names and values for vars sent by index.lib.php3 if (isset($HTTP_GET_VARS)) { while(list($name,$value) = each($HTTP_GET_VARS)) { $$name = $value; }; };
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
4
by: willers | last post by:
Hi All, I have created a web site using Frontpage2003 that I have also used to create an Access database to store info on. I am now trying to add a 'Search' facilty where it will search a...
7
by: underground | last post by:
I have a problem that I've spent countless hours on and I'm more than certain this is a obviuos issue to an expert but I am still learning. I have a paging script that I have modified to display a...
3
by: blackrunner | last post by:
ERROR in my Query?! ERROR: Element GESCHLECHT is undefined in FORM. i think everything ok. Maby somebody can help me here Element GESCHLECHT is undefined in FORM. The error occurred...
5
by: webandwe | last post by:
Hi, I have a normal table with 3 rows. In the middle row I added antoher table with my php search script (search in the database). If you view the page the first time the 3rd row footer is...
17
by: malathib | last post by:
Hi, I have used a rich text editor in my application. I got it from one of the site.all are JS files. My problem is, i want to call a javascript function from the iframe. Can anybody help...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.