|
-
Jun 23rd, 2006, 02:09 AM
#1
[CSS] Table width
Hi all,
I must have had a cerebral injection of curry or something because today has been one massive brain fart. Anyway, the situation is thus. I have a humungous HTML table that extends off the screen in about 15 dimensions, and naturally I would like to constrain it somewhat. Applying height to the tbody works, but I cannot seem to get the thing to be 100% width (i.e. fitting within the viewport).
What I eventually want to do is scroll, in both directions, within the tbody, whilst the whole table fits within the screen. The only problem is width-wise it refuses to play ball. Possibly it is spite, but I am hoping there is simply something I'm missing. Any thoughts?
Cheers
- P
-
Jun 24th, 2006, 05:49 PM
#2
Re: [CSS] Table width
Take a look at this: http://adam.codedv.com/examples/table_width.html
The trick is to turn the table and the tbody elements into block elements. Block elements, unlike inline elements respond to width constraints.
-
Jun 24th, 2006, 06:00 PM
#3
Re: [CSS] Table width
Thanks! I didn't know that.
But, surprise surprise, it doesn't work in IE.
Could it be that IE does not recognise the overflow property on tables?
-
Jun 24th, 2006, 06:16 PM
#4
Re: [CSS] Table width
Have another look. If you don't mind putting the table in a div, you can use that to enforce the width.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|