CSS & Tables
Hi
Ive set all my font styles and they stay the same, but when I switch the view text mode to higher or smaller the tables seem to expand (higher text size) or shrink (low text size). What part of css would make them stay the same please. Thanks
Rory
Suzanne posted this at 08:00 — 15th December 2001.
She has: 5,507 posts
Joined: Feb 2000
It's not the CSS that's causing the tables to expand, it's the font size.
If you want to be able to increase or decrease your font size, without affecting the table size, you will have to use absolute widths for the table instead of percentages.
If you want to have the table fluid and resizable, you will have to set the font size in the CSS in px so it isn't resizable.
There is no inbetween.
Suzanne
disaster-master posted this at 08:16 — 15th December 2001.
She has: 2,154 posts
Joined: May 2001
I'm no expert but I found this link:
http://www.faqts.com/knowledge_base/view.phtml/aid/8553/fid/337
Also, I checked some of my sites and in pages were I am using something like this below it will let you resize:
<style type="text/css">
A:link { text-decoration: none; color:"#000000" }
A:visited { text-decoration: none; color:"#000000" }
A:hover { text-decoration: none; color:"FF0000" }
</style>
BUT when I used something like this it doesn't:
<td valign="top" height="190" class="main">
'That is a good question. I will be waiting for Suzanne to give you the correct answer.
OPPPS...She beat me to the punch.
Rory Knowles posted this at 09:06 — 15th December 2001.
They have: 4 posts
Joined: Dec 2001
So the tables will still move unless I have the tables and tds set to pixles and not percentages then ..?
Suzanne posted this at 21:06 — 15th December 2001.
She has: 5,507 posts
Joined: Feb 2000
Having the tables in percentages means that they can move about as needed.
Unfortunately the max/min concept (in CSS) isn't supported at this time, so I can't offer you a CSS solution to table sizing.
Suzanne
Rory Knowles posted this at 21:23 — 15th December 2001.
They have: 4 posts
Joined: Dec 2001
I was looking at another site that the tables did not resize, but they used percentage on all the tables, would it mean using a fixed font on the td instead and not the table? Also, does it mean the height as well as the width needs to be fixed in pixels? Should I even be worrying about it ..heres the page: (its still under construction)
http://www.aspbahamas.com/index.asp
by the way im more into coding then design, doing vbscript in ASP for a couple of years now, which is why im just getting into CSS
thanks
Rory
Suzanne posted this at 22:35 — 15th December 2001.
She has: 5,507 posts
Joined: Feb 2000
No, even with a fixed font, the tables will resize based on the text if they are in percentages. However, there are some things that appear to be exceptions (they aren't).
1. using a percentage table within an absolute table cell -- it won't change shape, but it's the parent td that is keeping it from changing.
2. Using images or formatting the text so it doesn't expand if there is more room.
3. Putting the (invalid) attribute in a td (can cause all sorts of other issues, though).
You can mix a relative table with absolute cells, too. So the table could be 100%, but the first column set to 150 pixels.
Or the other way around -- table set to 500 pixels, but the columns set to percentages or not set at all, just dependent on the content.
***
It's best not to set the height at all, let the content set the height. Height is deprecated.
Suzanne
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.