table td font size inheritance

table td font size inheritance

am 29.12.2007 00:13:04 von Jeremy

Generally, I want all html on my page to have a size of 10pt, so I
have a style set:

body, div, input, select, span, td, th, legend, textarea, a, a:hover
{
font-size: 10pt;
}

I use this because I've found (at least with IE which I must support)
that not all elements inherit the font size so I set the size
explicitely explicitly. This worked well until I needed a table in my
page with 8pt text in the cells.

I set the size in the style of the table and nothing worked. is there
any way to get this to work by setting the table style, and not the
individual cells? I find it strange that the cell font size doesn't
inherit from the table style and instead uses the global style.

Re: table td font size inheritance

am 29.12.2007 00:27:32 von a.nony.mous

jeremy wrote:

> Generally, I want all html on my page to have a size of 10pt,

Points are for printing, not web pages. Use percentages instead. See:
http://k75s.home.att.net/fontsize.html

> .. This worked well until I needed a table in my page with 8pt text in
> the cells.

8? Unreadable.

--
-bts
-Friends don't let friends drive Vista

Re: table td font size inheritance

am 29.12.2007 01:03:21 von Neredbojias

Well bust mah britches and call me cheeky, on Fri, 28 Dec 2007 23:13:04 GMT
jeremy scribed:

> Generally, I want all html on my page to have a size of 10pt, so I
> have a style set:
>
> body, div, input, select, span, td, th, legend, textarea, a, a:hover
> {
> font-size: 10pt;
> }
>
> I use this because I've found (at least with IE which I must support)
> that not all elements inherit the font size so I set the size
> explicitely explicitly. This worked well until I needed a table in my
> page with 8pt text in the cells.
>
> I set the size in the style of the table and nothing worked. is there
> any way to get this to work by setting the table style, and not the
> individual cells? I find it strange that the cell font size doesn't
> inherit from the table style and instead uses the global style.

Did you remove the "td" from the main (above) style list?

I can make a lot more guesses but without having some data to work with...

--
Neredbojias
Riches are their own reward.

Re: table td font size inheritance

am 29.12.2007 01:03:26 von Rob_W

jeremy schreef:
> Generally, I want all html on my page to have a size of 10pt, so I
> have a style set:
>
> body, div, input, select, span, td, th, legend, textarea, a, a:hover
> {
> font-size: 10pt;
> }
>
> I use this because I've found (at least with IE which I must support)
> that not all elements inherit the font size so I set the size
> explicitely explicitly. This worked well until I needed a table in my
> page with 8pt text in the cells.
>
> I set the size in the style of the table and nothing worked. is there
> any way to get this to work by setting the table style, and not the
> individual cells? I find it strange that the cell font size doesn't
> inherit from the table style and instead uses the global style.


If I understand correctly, you now have this:

body, div, input, select, span, td, th, legend, textarea, a, a:hover
{
font-size: 10pt;
}

table
{
font-size: 8pt;
)


Right?


--
Rob

Re: table td font size inheritance

am 29.12.2007 01:39:56 von Michael Fesser

..oO(jeremy)

>Generally, I want all html on my page to have a size of 10pt, so I
>have a style set:

You don't want to use pt on a web page. Use em or %.

>body, div, input, select, span, td, th, legend, textarea, a, a:hover
>{
> font-size: 10pt;
>}

body {
font-size: ...
}

is enough on a properly built site.

>I use this because I've found (at least with IE which I must support)
>that not all elements inherit the font size so I set the size
>explicitely explicitly. This worked well until I needed a table in my
>page with 8pt text in the cells.

Make sure your pages are rendered in standards mode, not in quirks mode.

>I set the size in the style of the table and nothing worked. is there
>any way to get this to work by setting the table style, and not the
>individual cells? I find it strange that the cell font size doesn't
>inherit from the table style and instead uses the global style.

It's a known IE bug in quirks mode.

Micha

Re: table td font size inheritance

am 29.12.2007 02:33:56 von dorayme

In article
m>,
jeremy wrote:

> Generally, I want all html on my page to have a size of 10pt, so I
> have a style set:
>
> body, div, input, select, span, td, th, legend, textarea, a, a:hover
> {
> font-size: 10pt;
> }
>
> I use this because I've found (at least with IE which I must support)
> that not all elements inherit the font size so I set the size
> explicitely explicitly. This worked well until I needed a table in my
> page with 8pt text in the cells.
>
> I set the size in the style of the table and nothing worked. is there
> any way to get this to work by setting the table style, and not the
> individual cells? I find it strange that the cell font size doesn't
> inherit from the table style and instead uses the global style.

Let me talk about good browsers. Tell me if it does not apply to
IE.

There is nothing "global" about your instruction to td. It is
very specific. If you tell table one thing and you tell td
another, surely you would expect the cell to listen to you rather
than to listen to its ancestor. You as author are like a god and
if you speak directly to the descendant, it obeys you.

Lets simplify and exaggerate:

body, td {font-size: 50pt;}

is equivalent to

body {font-size: 50pt;}

td {font-size: 50pt;}

(not much global about the latter.)

If you now set

table {font-size: 5pt;} and have a table heading in it you will
see text in the cell huge and the heading tiny. The only thing
that listens to the table font-size is the th in this. What else
should it listen to in the circumstances? The td knows what to do
because you have informed it directly here.

In other words, set td directly to your preferred font-size (you
can remove it from your list or simply add on the next line

td {font-size: 8pt;}

--
dorayme