Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Table border and CSS

0 views
Skip to first unread message

Gianni

unread,
Jul 2, 2009, 10:42:54 PM7/2/09
to
If I do:

<table border="1">

I get a border.

I have three of four different tables.
I would like to set them up without
border="1":

<table>

and use css to turn the border on
or off. Is it possible?

dorayme

unread,
Jul 2, 2009, 11:00:24 PM7/2/09
to

Yes.

<table class="bestBuys">
<table class="planets">
<table class="topEconomies">

and in the CSS, one way to target the ones that you want a border for
might be:

.planets {border: 1px solid #000}

The others will be borderless by default.

If you want the cells themselves to have borders, one way is no border
to table itself but:

table {border-collapse: collapse}
td {border: 1px solid #000;}

--
dorayme

Gianni

unread,
Jul 3, 2009, 11:03:32 AM7/3/09
to
Thank you.
Your suggestions work exactly what I was
looking for.

Jukka K. Korpela

unread,
Jul 3, 2009, 1:11:55 PM7/3/09
to
dorayme wrote:

>> <table border="1">
- -


> .planets {border: 1px solid #000}

That sets a border around the whole table only, which is different from the
effect of the HTML attribute.

> If you want the cells themselves to have borders, one way is no border
> to table itself but:
>
> table {border-collapse: collapse}
> td {border: 1px solid #000;}

This generates yet another type of bordering. Quite possibly better than the
HTML way, but nominally the OP asked for a replacement of <table
border="1">. There is no replacement, as the effect of the HTML construct
depends on the browser in a manner that cannot (and probably need not) be
reproduced in CSS.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Ben C

unread,
Jul 3, 2009, 1:37:21 PM7/3/09
to

What can you do with the border attribute that you can't do with CSS?

Jukka K. Korpela

unread,
Jul 3, 2009, 1:46:14 PM7/3/09
to
Ben C wrote:

> What can you do with the border attribute that you can't do with CSS?

What I said - generate borders in browser-dependent, undocumented manner.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

jeff

unread,
Jul 3, 2009, 2:08:53 PM7/3/09
to
Jukka K. Korpela wrote:
> Ben C wrote:
>
>> What can you do with the border attribute that you can't do with CSS?
>
> What I said - generate borders in browser-dependent, undocumented manner.
>
I think Yukka must be working from an undisclosed location. When do
we get to see the undocumented behaviour of <table border="1"> ?

Jeff

Jukka K. Korpela

unread,
Jul 3, 2009, 2:31:37 PM7/3/09
to
Biff wrote:

> I think Yukka must be working from an undisclosed location.

Try using my real name or my nickname, not a spelling you invented, and
maybe I'll stop calling you Biff.

> When do
> we get to see the undocumented behaviour of <table border="1"> ?

As soon as you bother testing the effect of that construct on some browsers,
I guess.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

jeff

unread,
Jul 3, 2009, 2:37:04 PM7/3/09
to
Jukka K. Korpela wrote:
> Biff wrote:
>
>> I think Yukka must be working from an undisclosed location.
>
> Try using my real name or my nickname, not a spelling you invented, and
> maybe I'll stop calling you Biff.

Maybe you should look at your own sig line:

Yucca, http://www.cs.tut.fi/~jkorpela/

Since English is not your native spelling how the hell was I supposed
to know that you didn't want to use *your* signature. I've seen it for
years.


>
>> When do
>> we get to see the undocumented behaviour of <table border="1"> ?
>
> As soon as you bother testing the effect of that construct on some
> browsers, I guess.

Same old Jukka.


Jeff
>

Jukka K. Korpela

unread,
Jul 3, 2009, 3:04:35 PM7/3/09
to
Biff wrote:

> Jukka K. Korpela wrote:
>> Biff wrote:
>>
>>> I think Yukka must be working from an undisclosed location.
>>
>> Try using my real name or my nickname, not a spelling you invented,
>> and maybe I'll stop calling you Biff.
>
> Maybe you should look at your own sig line:
>
> Yucca, http://www.cs.tut.fi/~jkorpela/

And where do you see the name you used?

As you are not paying attention and you are posting messages with no
on-topic content, and as you avoid the on-topic point I made, you get close
to ranking as a nuisance.

ObCSS: Note that CSS specifications do not in any way define _how_ the
presentational HTML markup that might be "honored" is to be interpreted in
CSS terms.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

jeff

unread,
Jul 3, 2009, 3:27:37 PM7/3/09
to
Jukka K. Korpela wrote:
> Biff wrote:
>
>> Jukka K. Korpela wrote:
>>> Biff wrote:
>>>
>>>> I think Yukka must be working from an undisclosed location.
>>>
>>> Try using my real name or my nickname, not a spelling you invented,
>>> and maybe I'll stop calling you Biff.
>>
>> Maybe you should look at your own sig line:
>>
>> Yucca, http://www.cs.tut.fi/~jkorpela/
>
> And where do you see the name you used?
>

Fine O Obtuse One, I missed the c's


> As you are not paying attention and you are posting messages with no
> on-topic content, and as you avoid the on-topic point I made, you get
> close to ranking as a nuisance.

So, put me in your kill file. I've got better things to do than
fruitless arguments.

Jeff

Chris F.A. Johnson

unread,
Jul 3, 2009, 3:32:56 PM7/3/09
to
On 2009-07-03, Jukka K. Korpela wrote:
> Biff wrote:
>
>> I think Yukka must be working from an undisclosed location.
>
> Try using my real name or my nickname, not a spelling you invented, and
> maybe I'll stop calling you Biff.

Which is your real name? The one in the From: line (Yukka) or the
one in your sig (Yucca)?

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

Rob W.

unread,
Jul 3, 2009, 4:06:41 PM7/3/09
to
Chris F.A. Johnson schreef:

> On 2009-07-03, Jukka K. Korpela wrote:
>> Biff wrote:
>>
>>> I think Yukka must be working from an undisclosed location.
>> Try using my real name or my nickname, not a spelling you invented, and
>> maybe I'll stop calling you Biff.
>
> Which is your real name? The one in the From: line (Yukka) or the
> one in your sig (Yucca)?
>


You might want to buy a box of tissues
to clean your screen.

--
Rob

jeff

unread,
Jul 3, 2009, 4:49:20 PM7/3/09
to
Who knows the ins and outs of Finnish? Why can't Yucca just say
something plainly instead of making a needless game of it?

My own opinion is that Yucca was much more tolerable when Alan was
still around. I'm not even sure where he is going. Clearly the web is
headed towards standards based table free layouts styled in the
stylesheet, why is Yucca promulgating tables and archaic attribute in
the html styling? I can think of several recent examples of this.

Jeff

Jukka K. Korpela

unread,
Jul 3, 2009, 5:15:49 PM7/3/09
to
jeff wrote:

> Who knows the ins and outs of Finnish?

I hope you will fix your forged From field as soon as you get a clue and
start discussing on-topic issues. Meanwhile, your explicit desire to get
ignored should be honored.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Ben C

unread,
Jul 3, 2009, 5:19:35 PM7/3/09
to
On 2009-07-03, Jukka K. Korpela <jkor...@cs.tut.fi> wrote:
> Ben C wrote:
>
>> What can you do with the border attribute that you can't do with CSS?
>
> What I said - generate borders in browser-dependent, undocumented manner.

Do you have an example? I would be interested to know.

Ben C

unread,
Jul 3, 2009, 5:44:44 PM7/3/09
to
On 2009-07-03, Jukka K. Korpela <jkor...@cs.tut.fi> wrote:

Firefox for one appears to convert HTML presentational attributes into
CSS (including possibly special custom CSS-- new properties and/or
values that start with -moz- for example-- although I can't remember if
or where I saw that, and I don't think it was for border).

This is just a reasonably obvious implementation decision. You've just
written a bit of software that does CSS layout, so you might as well use
it to do HTML presentational attributes too. You're right that the CSS
specs don't spell out how you would do this.

It's undefined quite how presentational attributes mix with any real CSS
that might be in effect, and this gets particularly confusing for
attributes that are inherited as described in HTML-- you might inherit a
CSS border from somewhere and inherit, in the HTML sense, a different
border from somewhere else. It may be logically impossible to conform to
both the HTML standard and the CSS specs at the same time.

I've also never seen any browser implement presentational attributes
exactly according to the HTML standard, but I get the impression the
standard post-dates the "legacy" behaviour that is the common ancestor
that browser implementors are aiming to provide compatibility with and
the standards writers to document.

Adrienne Boswell

unread,
Jul 3, 2009, 11:31:02 PM7/3/09
to
Gazing into my crystal ball I observed Ben C <spam...@spam.eggs>
writing in news:slrnh4std0....@bowser.marioworld:

Here you go:
http://www.cavalcade-of-coding.info/usenet/tablecssborder.html

Different browsers do different things. I didn't fire up Firefox or
Chrome or Safari or K-Meleon, but you can see the difference even
between Opera and IE.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

dorayme

unread,
Jul 3, 2009, 11:54:43 PM7/3/09
to
In article <MZq3m.19981$vi5....@uutiset.elisa.fi>,

"Jukka K. Korpela" <jkor...@cs.tut.fi> wrote:

> dorayme wrote:
>
> >> <table border="1">
> - -
> > .planets {border: 1px solid #000}
>
> That sets a border around the whole table only, which is different from the
> effect of the HTML attribute.
>

Yes, I agree. In addition, the HTML set border is often rather nicer in
many browsers than a simple border set in CSS. One has to work a bit to
get the pleasant rough equivalent.

Anyone doing a Phd on borders this weekend might want to build and
expand around:

<http://dorayme.netweaver.com.au/tableBorders.html>

(Notice, btw, how Opera seems not to understand the ordered list as it
should. The OL is not strictly relevant here.)

> > If you want the cells themselves to have borders, one way is no border
> > to table itself but:
> >
> > table {border-collapse: collapse}
> > td {border: 1px solid #000;}
>
> This generates yet another type of bordering. Quite possibly better than the
> HTML way, but nominally the OP asked for a replacement of <table
> border="1">. There is no replacement, as the effect of the HTML construct
> depends on the browser in a manner that cannot (and probably need not) be
> reproduced in CSS.

Yes, I agree with this too. But I have never been all that happy with
nominalism. I thought the OP, under the nominal surface, would be happy
with the substitutes mentioned.

There is a rather good 'semantic argument' to use an HTML set border, it
has always struck me that borders on tables are rather important to
understand the meaning of the data. The borders stay (if not set to zero
in the HTML) if CSS is off.

A table is a mainly visual presentational device (yes, for presenting
tabular data if you like, this is not here in dispute) at its core and
we should be careful before dispensing with borders. It has always
seemed to me that having no borders on tables is a positive
presentational decision. This last reminds me of:

Jean-Paul Sartre is sitting at a French cafe, revising his draft of
Being and Nothingness. He says to the waitress, "I'd like a cup of
coffee, please, with no cream." The waitress replies, "I'm sorry,
monsieur, but we're out of cream. How about with no milk?"

--
dorayme

Ben C

unread,
Jul 4, 2009, 2:11:28 AM7/4/09
to
On 2009-07-04, Adrienne Boswell <arb...@yahoo.com> wrote:
> Gazing into my crystal ball I observed Ben C <spam...@spam.eggs>
> writing in news:slrnh4std0....@bowser.marioworld:
>
>> On 2009-07-03, Jukka K. Korpela <jkor...@cs.tut.fi> wrote:
>>> Ben C wrote:
>>>
>>>> What can you do with the border attribute that you can't do with
>>>> CSS?
>>>
>>> What I said - generate borders in browser-dependent, undocumented
>>> manner.
>>
>> Do you have an example? I would be interested to know.
>>
>
> Here you go:
> http://www.cavalcade-of-coding.info/usenet/tablecssborder.html
>
> Different browsers do different things. I didn't fire up Firefox or
> Chrome or Safari or K-Meleon, but you can see the difference even
> between Opera and IE.

It's the same in Firefox-- and just what one would expect. border=1
gives you a border on the table and the cells. So if you only set a
border on the table in CSS, you only get a border on the table.

I was wondering if there was some behaviour of the border attribute you
just couldn't do with CSS (expecting something involving page breaks and
captions or something-- because I know that is an area I don't know much
about).

Jukka K. Korpela

unread,
Jul 4, 2009, 11:17:15 AM7/4/09
to
dorayme wrote:

> There is a rather good 'semantic argument' to use an HTML set border,
> it has always struck me that borders on tables are rather important to
> understand the meaning of the data. The borders stay (if not set to
> zero in the HTML) if CSS is off.

Good point. I routinely use border="1" for data tables, then override it
with a set of CSS rules. In fact, I think the reason why it is not a default
is that the specs writers and browser vendors thought that most tables will
be for layout, and then borders usually aren't desirable.

> It has always
> seemed to me that having no borders on tables is a positive
> presentational decision.

I don't quite understand, even though you gave a hint on potential
absurdity.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

William Gill

unread,
Jul 4, 2009, 11:57:42 AM7/4/09
to
It is sometimes difficult to see clearly when Jukka �Yucca� Korpela
displays his impaired interpersonal skills. However, once one has
mastered the are of ignoring the static, they can usually find some
useful information in his replies. You don't have to like him to
appreciate him.

Rob W.

unread,
Jul 4, 2009, 12:04:08 PM7/4/09
to
William Gill schreef:


This was about Chris not being able to tell a J from a Y.

dorayme

unread,
Jul 4, 2009, 7:13:15 PM7/4/09
to
In article <%nK3m.20297$vi5....@uutiset.elisa.fi>,

"Jukka K. Korpela" <jkor...@cs.tut.fi> wrote:

> dorayme wrote:
>
> > There is a rather good 'semantic argument' to use an HTML set border,
> > it has always struck me that borders on tables are rather important to
> > understand the meaning of the data. The borders stay (if not set to
> > zero in the HTML) if CSS is off.
>

> ... I think the reason why it is not a default

> is that the specs writers and browser vendors thought that most tables will
> be for layout, and then borders usually aren't desirable.
>

Yes, that is what I was thinking but could not prove.



> > It has always
> > seemed to me that having no borders on tables is a positive
> > presentational decision.
>
> I don't quite understand, even though you gave a hint on potential
> absurdity.

I meant something quite simple and not that different to the semantic
argument I referred to. In fact, your explanation of the motivations of
the specs writers and browser vendors is the point. To leave off borders
is a presentational decision, if they had communication and semantics in
mind, a border (*usually*, this is the point) helps a lot to see the
relationships that are meant to be seen in what is often called here a
real 'tabular' affair.

--
dorayme

William Gill

unread,
Jul 5, 2009, 1:49:37 PM7/5/09
to

Or a couple of c'c from a couple of k's. Do you think there may be any
relationship between Mr. Korpela's name and his nickname?

"...sometimes difficult to see clearly..."
I don't know about you (or Chris), but I make more mistakes reading (and
typing) when I'm "seeing red." Hell, I have enough trouble when I'm
not, otherwise I might have typed "...mastered the art..." instead of
"...mastered the are..."


Rob W.

unread,
Jul 5, 2009, 4:09:25 PM7/5/09
to
William Gill schreef:
> Rob W. wrote:
>>
>>
>> This was about Chris not being able to tell a J from a Y.
>>
>
> Or a couple of c'c from a couple of k's. Do you think there may be any
> relationship between Mr. Korpela's name and his nickname?
>
>


You don't read very well, do you.
Actually Chris got the c's and the k's just right,
k's in the From-line and c's in the sig. But he spelled Yukka instead of
Jukka.


That's one of the things I appreciate in Jukka's posts;
he likes to take things literally and he's good with specifications.

--
Rob

William Gill

unread,
Jul 5, 2009, 5:31:19 PM7/5/09
to
Rob W. wrote:
> William Gill schreef:
>> Rob W. wrote:
>>>
>>>
>>> This was about Chris not being able to tell a J from a Y.
>>>
>>
>> Or a couple of c'c from a couple of k's. Do you think there may be
>> any relationship between Mr. Korpela's name and his nickname?
>>
>>
>
>
> You don't read very well, do you.
> Actually Chris got the c's and the k's just right,
> k's in the From-line and c's in the sig. But he spelled Yukka instead of
> Jukka.

And you obviously don't think very well, do you. I saw the differences
and the similarities, as well as the numerous ways the mistake could be
made.

I could conceivably be convinced to have Chris banished for his sin, as
you seem to support, but then I would miss his frequent contribution,
and valued perspective. Maybe we could just make him wear a scarlet
letter, but then how would that work in a NG?

> That's one of the things I appreciate in Jukka's posts;
> he likes to take things literally and he's good with specifications.
>

It is what I appreciate in him also, but I recognize that outside of
mathematics it is difficult to find anything as rigid, exacting, and
uncompromising as those who can only see things from their own
(frequently narrow) perspective. I have seen many that fit this mold,
and unfortunately have seen most of them assume the worst in others. I
have as yet never seen any achieve the level of infallibility in
themselves, that they castigate others for lacking. That includes Jukka
�Yucca� Korpela.

In one previous life I was an engineer. Many of my contemporaries
believed in the absolutes of their work, "I works that way because
that's how I designed it to work." I however choose to spend more time
in the field examining the differences between the imperfect environment
in which the equipment actually operated, and the perfect environment of
the drawing table. My stuff always worked, because "That's how I
adapted the design to work."

So when I need an exacting interpretation of html and css rules, and
their implications, I will listen intently to what Mr. Korpela says.
However, when I deal with mere mortals such as myself, I will strive for
a little more flexibility.

Ben C

unread,
Jul 5, 2009, 5:53:55 PM7/5/09
to
On 2009-07-05, William Gill <nos...@domain.invalid> wrote:
> Rob W. wrote:
[...]

>> That's one of the things I appreciate in Jukka's posts;
>> he likes to take things literally and he's good with specifications.
>>
>
> It is what I appreciate in him also, but I recognize that outside of
> mathematics it is difficult to find anything as rigid, exacting, and
> uncompromising as those who can only see things from their own
> (frequently narrow) perspective. I have seen many that fit this mold,
> and unfortunately have seen most of them assume the worst in others. I
> have as yet never seen any achieve the level of infallibility in
> themselves, that they castigate others for lacking. That includes Jukka
> �Yucca� Korpela.

>
> In one previous life I was an engineer. Many of my contemporaries
> believed in the absolutes of their work, "I works that way because
> that's how I designed it to work." I however choose to spend more time
> in the field examining the differences between the imperfect environment
> in which the equipment actually operated, and the perfect environment of
> the drawing table. My stuff always worked, because "That's how I
> adapted the design to work."
>
> So when I need an exacting interpretation of html and css rules, and
> their implications, I will listen intently to what Mr. Korpela says.
> However, when I deal with mere mortals such as myself, I will strive for
> a little more flexibility.

But Korpela is always very careful only to recommend things that work
even in broken browsers or with CSS turned off, etc.

William Gill

unread,
Jul 5, 2009, 9:07:15 PM7/5/09
to
Ben C wrote:
> But Korpela is always very careful only to recommend things that work
> even in broken browsers or with CSS turned off, etc.

Yes, but (I noticed you began your statement with a "but") how often
does he do it without pointing out how clueless someone somewhere is
(the OP, a responder, someone)? I once had a discussion with him where
I wanted to use the same identifier on different elements (i.e.
paragraph, heading or whatever). He in his usual tactful way pointed
out my ignorance of the requirement that ID's be unique. I hadn't
mentioned "not on the same document" because ID's "...must be unique in
a document..." so it was implied. I could have said how clueless he was
to not realize one stylesheet can be shared by numerous pages, and that
a paragraph on one page could share the ID (and thus styling) with a
different element on another page, but I didn't assume the worst of him,
and recognized it was a mutual miscommunication.

I fear this is beginning to look like a criticism of Mr. Korpela, when
it was intended as a defense of accidentally confusing his nickname and
his proper name, and coming up with neither. Maybe defense is too
strong, mitigation may be a better choice. I'm sure Mr. Johnson has
been beating himself up mercilessly for the past several days.

Ben C

unread,
Jul 6, 2009, 2:39:37 AM7/6/09
to
On 2009-07-06, William Gill <nos...@domain.invalid> wrote:
> Ben C wrote:
>> But Korpela is always very careful only to recommend things that work
>> even in broken browsers or with CSS turned off, etc.
>
> Yes, but (I noticed you began your statement with a "but") how often
> does he do it without pointing out how clueless someone somewhere is
> (the OP, a responder, someone)?

The "but" was because you seemed to be likening him to the perfectionist
engineer rather than to the practical pragmatic one.

> I once had a discussion with him where I wanted to use the same
> identifier on different elements (i.e. paragraph, heading or
> whatever). He in his usual tactful way pointed out my ignorance of
> the requirement that ID's be unique. I hadn't mentioned "not on the
> same document" because ID's "...must be unique in a document..." so it
> was implied. I could have said how clueless he was to not realize one
> stylesheet can be shared by numerous pages, and that a paragraph on
> one page could share the ID (and thus styling) with a different
> element on another page, but I didn't assume the worst of him, and
> recognized it was a mutual miscommunication.

Well, I couldn't possibly comment.

I enjoy a good quibble with Mr K in the same way that one enjoys a
really good game of chess with the Grim Reaper, but if there's one thing
he doesn't like, it's being psychoanalyzed.

jeff

unread,
Jul 6, 2009, 4:26:55 PM7/6/09
to
Jukka K. Korpela wrote:
> jeff wrote:
>
>> Who knows the ins and outs of Finnish?
>
> I hope you will fix your forged From field

That is a real email address, the one assigned by my ISP.

as soon as you get a clue and
> start discussing on-topic issues.

I'd rather appreciate you holding off personal attacks, it's is not
complimentary. And you have snipped without attribution everything on topic.

Meanwhile, your explicit desire to get
> ignored should be honored.
>

Thank you.

Jeff

0 new messages