Style for table

T

Tora

I have one html-file & one css-file.
All works fine with the styles except for the element TABLE

When i write in the html-file

TABLE border="1" frame="box"

all works fine, but when i do the following in the html-file

TABLE class="mystyle"

and then in the css

TABLE.mystyle
{ border: 1;
frame: box;
}

The table stays without border and no frame


How come ?
 
T

Toby A Inkster

Tora said:
TABLE.mystyle
{ border: 1;
frame: box;
}

Perhaps:

table.mystyle {
border: 1px dotted blue;
}

or

table.mystyle {
border: 1px solid red;
}

or even

table.mystyle, table.mystyle td, table.mystyle th {
border: 1px solid #ccc;
}
 
A

Allen

Hello Toby,

Monday, September 8, 2003, 3:08:55 AM, you wrote:


TAI> Perhaps:

TAI> table.mystyle {
TAI> border: 1px dotted blue;
TAI> }

To elaborate,
when specifying a border in css, you MUST specify more than just the
size attribute; you need to also specify a style { such as dotted,
dashed, solid } and, preferably, a color. Toby gave you some good
examples of how this can be done.

Allen
 
T

Toby A Inkster

Allen said:
when specifying a border in css, you MUST specify more than just the
size attribute; you need to also specify a style { such as dotted,
dashed, solid } and, preferably, a color.

Hmmm... it is possible to just specify a border width. The important thing
is to qualify your number (1) with a unit (em, px, ex, %, etc).
 
C

Crepe

Toby,

Monday, September 8, 2003, 2:07:07 PM, you wrote:


TAI> Hmmm... it is possible to just specify a border width. The important thing
TAI> is to qualify your number (1) with a unit (em, px, ex, %, etc).

Indeed, it is -possible-, but poor practice. My wording was
over-the-top, I'll admit. But if you want your page rendering to be
concise/consistent from browser to browser, platform to platform, it
is wise to specify specifics. While the css specifications DO outline
what SHOULD be used by default if no user-defined attributes are
specified, these are not always followed. IE is the biggest proponent
of bad-standards-compliance.

Be well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top