View Full Version : javascript to change fontsize in tables

03-31-2003, 01:03 PM
I'm building a site for diffirent screen resolutions. But i can't find out how to change the fontsize in tables. The code in the tables has already been written and can't be changed. I use this code in the stylesheet for tables.

Table { font-family : Arial;
font-size : 12pt;

It must be possible to use javascript to change that into a diffirent size, right?
I use document.write for fonts outside tables. If you know a better way to do this, it would be welcome too.



04-01-2003, 07:40 AM
document.write doesn't work satisfactory either. I have another question. Is it possible to switch between stylesheets using javascript or anything else?

04-01-2003, 08:26 AM
for the stylesheet switcher:


04-01-2003, 10:22 AM
You can use DOM 2 CSS to rewrite stylesheet values on the fly. I asked something similar quite recently - http://codingforums.com/showthread.php?s=&threadid=14259

04-01-2003, 11:21 AM
For a stylesheet switcher using all stylesheets instead of only link tags - ThemeSwitcher (http://liorean.web-graphics.com/scripts/themeswitch.html).

As for the stylesheets collection, just a small support notice:
DOM CSS is only supported in saf/konq, iem (support for both, but not as complete as moz, saf or iew) and moz as of now. iew got it's own stylesheets collection properties.

Most notably, Op7 hasn't got the styleSheets collection.

04-02-2003, 03:11 PM
I've got all that i needed, thanks to you all.