[Gllug] [OT?] Please sign my Google petition ...

Richard Turner richard at zygous.co.uk
Wed Jun 9 12:32:54 UTC 2004


Tethys wrote:
> "Daniel P. Berrange" writes:
> 
>> Eric Meyer's book showed the lowdown on this:
>> 
>>  <table id=3D"mytable">
>>  </table>
>> 
>> 
>> #mytable {
>>  width: 60%;
>>  margin-left: auto;
>>  margin-right: auto;
>> }
> 
> That's not a solution. It's a crude hack, and it doesn't give the same
> behaviour as <div align="center">. It only works if you specify a
> fixed width table. How do you know how wide the table should be? It's
> dependent 
> on the font size in the user-agent, for example, and 99% of the time,
> you'll either guess too wide (in which case the table may
> theoretically be centred, but to the end us it will appear off centre
> to the left) or too narrow (in which case you'll get more line
> wrapping than is desirable). I want a centred natural width table.
> This is an area where CSS is currently weak AFAIK. 
> 
> Tet

If you use qualitative values for text size, i.e. 'medium', 'larger',
x-small, etc. you can set the width of the table in 'em' units, which neatly
solves this problem.

Formatting shouldn't be done in the HTML: you exclude so much of your
audience if you do that.

Cheers,

Richard.
-- 
"Racing turtles, the grapefruit is winning..."


-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list