Results 1 to 4 of 4

Thread: [CSS] Table width

Hybrid View

  1. #1

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Arrow [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

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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?

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width