How define the fonts for the whole table?

M

Manfred Ullrich

the font-definition outside the table is not valid within the table.
I have to define it in every <td> within the table..
Isn't it possible to define it once for the whole table?

Thanks, Manfred
 
A

Adrienne Boswell

the font-definition outside the table is not valid within the table.
I have to define it in every <td> within the table..
Isn't it possible to define it once for the whole table?

Thanks, Manfred

Sure.

table {font-family: arial, verdana, sans-serif; font-size:100%;}
 
M

Manfred Ullrich

Adrienne Boswell said:
Sure.

table {font-family: arial, verdana, sans-serif; font-size:100%;}
I suppose your hint only works with stylesheets.
Isn't it possible to manage the problem without stylesheets?

Thanks, Manfred
 
G

Greg N.

Manfred said:
I suppose your hint only works with stylesheets.
Isn't it possible to manage the problem without stylesheets?

If it is external style sheets that you're uncomfortable with, you can
put a style section within the <head> part of your document:

<head>
<style type="text/css">
table {font-family: arial, verdana, sans-serif; font-size:100%;}
</style>
</head>

And if you feel that's still too exotic, you can put the style attribute
in the <table> tag itself, like so:

<table style="font-family: sans-serif; font-size:100%;}">
 
T

Toby Inkster

Manfred said:
I suppose your hint only works with stylesheets.
Isn't it possible to manage the problem without stylesheets?

Why? Using stylesheets is so much easier.

This is 2006, not 1996. CSS has wide support.
 
M

Manfred Ullrich

Greg N. said:
Oops, sorry. Make that
<table style="font-family: sans-serif; font-size:100%;">
Thank you,
I think when more than one table is on a page than this is the only way to treat the tables differently.
Isn't it?

Regards, Manfred
 
J

Jonathan N. Little

Manfred said:
Thank you,
I think when more than one table is on a page than this is the only way to treat the tables differently.
Isn't it?

No, if you have more than one table that your wish to style differently
they you can style by 'id' or 'class'.

CSS:
..naked {
border: 0;
border-collapse: collapse;
}

..naked TD { padding .5em; }

..funky {
border: 5px dotted red;
border-collapse: separate;
border-spacing: 1em;
}

..funky TD {
color: lime;
background-color: black;
border: 10px solid yellow;
}


HTML:
<table class="naked">
<tr><td>Table</td><td>Has</td></tr>
<tr><td>No</td><td>borders</td></tr>
</table>

<table class="funky">
<tr><td>Table</td><td>Has</td></tr>
<tr><td>borders</td><td>but</td></tr>
<tr><td>is</td><td>UGLY</td></tr>
</table>


By having the CSS in a separate file you can change the look of your
site by only having to change ONE file.
 
S

Stan McCann

Correct modern standard way (although I would lose the verdana).
I suppose your hint only works with stylesheets.
Isn't it possible to manage the problem without stylesheets?

It certainly is possible. But, if you go to your home builder and tell
him, "I don't want to use wood and shingle, I want to use straw on the
roof, isn't it possible?" Do you want to do it the standard way (the
way most that read/post here frequently),(the way most modern
construction companies work), or the 10 year (1000 years?) old way?
 
S

Stan McCann

Greg N. said:
Oops, sorry. Make that
<table style="font-family: sans-serif; font-size:100%;">

Oops, I missed that too. <slapping forehead>Duh!</slapping forehead>
 
D

dorayme

Adrienne Boswell said:
Sure.

table {font-family: arial, verdana, sans-serif; font-size:100%;}

Just a small side matter here, if I may...

Should this suggestion not be:

table {font-family: Arial, Verdana, sans-serif; font-size:100%;} ?

On the ground that the font name does not "belong" to css (things
that do so "belong" are case insensitive)
 
D

dorayme

Manfred Ullrich said:
I suppose your hint only works with stylesheets.
Isn't it possible to manage the problem without stylesheets?

Ah! So that's your game... :)
 
N

nice.guy.nige

While the city slept, Manfred Ullrich ([email protected]) feverishly
typed...
I suppose your hint only works with stylesheets.
Isn't it possible to manage the problem without stylesheets?

Now... why on Earth would you want to do that???

Cheers,
Nige
 
A

Adrienne Boswell

Gazing into my crystal ball I observed dorayme
Just a small side matter here, if I may...

Should this suggestion not be:

table {font-family: Arial, Verdana, sans-serif; font-size:100%;} ?

On the ground that the font name does not "belong" to css (things
that do so "belong" are case insensitive)

Maybe. For me, it's a writing style. I write just about everything
(markup/scripting) in lower case, with the exception of SQL keywords.
 
D

dorayme

Adrienne Boswell said:
Gazing into my crystal ball I observed dorayme


Maybe. For me, it's a writing style. I write just about everything
(markup/scripting) in lower case, with the exception of SQL keywords.

Well, I was wondering if, when we do this, it works fine only by
the grace of browsers (which might not be actually obliged to
recognise a font name in lower case? URLs are case sensitive and
occur in css, they will not always work well (online) if the
capital letters that are "supposed" to be in them are rendered as
lower case. In this latter, it would be unwise to adopt your
"writing style". But perhaps there is a different issue involved
in font names... perhaps the css somehow passes a request to the
system of the particular user's computer and the request is
"case-insensitive" (sensibly, what would be the chance of 2
fonts, verdana and Verdana)
 
A

Adrienne Boswell

Gazing into my crystal ball I observed dorayme
Well, I was wondering if, when we do this, it works fine only by
the grace of browsers (which might not be actually obliged to
recognise a font name in lower case? URLs are case sensitive and
occur in css, they will not always work well (online) if the
capital letters that are "supposed" to be in them are rendered as
lower case. In this latter, it would be unwise to adopt your
"writing style". But perhaps there is a different issue involved
in font names... perhaps the css somehow passes a request to the
system of the particular user's computer and the request is
"case-insensitive" (sensibly, what would be the chance of 2
fonts, verdana and Verdana)

CSS itself is case sensitive, so #MyHeader and <h1 id="myheader"> are not
the same. I found the out the hard way. Another one of the reasons I don't
like mixed case.
 
A

Alan J. Flavell

Well, I was wondering if, when we do this, it works fine only by
the grace of browsers (which might not be actually obliged to
recognise a font name in lower case?

The way in which a user agent matches a CSS font-family description
with one of the available fonts is deliberately not specified in
detail: it's left to implementers to decide how to make the best
match. For example, what should happen if the CSS specifies "Times",
and the user has "Times New Roman" (and not "Times")?

It stands to reason, though, that if a font is named "FooBar", then
the *best* way to match it, across different browsers and font
management systems, is by specifying "FooBar", rather than maybe
"foobar" or "Foobar" or "FOOBAR".
URLs are case sensitive and occur in css, they will not always work
well (online) if the capital letters that are "supposed" to be in
them are rendered as lower case.

This kind of analogy is not, in general, helpful. One has to consult
the actual specifications to know what is intended[1]

Sure: URLs are case-sensitive, by definition. But font name matching
is not so clearly defined.
(sensibly, what would be the chance of 2 fonts, verdana and Verdana)

Well, I've got a font family called "Monospace". CSS understands
monospace as a font keyword. They aren't (necessarily) the same font.
And the browsers know it.

h t h

[1] and then, I'm afraid, one usually has to examine MS's Operating
System Component, to see which of the mandatory requirements they
decided to break *this* time - fortunately, the other browser
developers can't afford to spit in the face of the specifications in
that way, so there's normally only that one troublemaker to worry
about.
 
D

dorayme

Adrienne Boswell said:
CSS itself is case sensitive, so #MyHeader and <h1 id="myheader"> are not
the same. I found the out the hard way. Another one of the reasons I don't
like mixed case.

Well, I think it is more true to say "CSS itself" is case
insensitive. There are special issues surrounding ids and classes
re their interpretation by browsers and the html (which has case
sensitivities). I still wonder about your use of "verdana"? It
looks wrong to me.

Generally I find it helpful to use case for readability, as in
#featuresColumn { etc in the CSS and id="featuresColumn" in the
html. But just be very consistent in this across in the html.
Yes, I realise you like to avoid the need by using all lower...

In the above name, #featuresColumn and #featurescolumn would be
quite the same as far as the CSS is concerned:

eg. one could have #featuresColumn p {color:red} and later in the
CSS sheet (or in a supplementary sheet), #featurescolumn p
{color:blue}

As far as the css is saying, all p paras in the id that is spelt
f e a t u r e s c o l u m n should be blue.

Browsers will react differently according to how they read the
standards, since ids and classes are mentioned in both css and
html, the former being case insensitive the latter sometimes at
least being case sensitive, there is somewhat a conflict of
interest.
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top