table column width control question

Discussion in 'HTML' started by coolsti, Sep 5, 2005.

  1. coolsti

    coolsti Guest

    How do I do this?

    I am presenting tabular data via a web interface. The browsers are the
    latest IE and Firefox. The number of columns of data is too large to fit
    on the page, so horizontal scrolling will be needed.

    I want to be able to hide blocks of rows of the table when the user
    clicks on certain icons and I can do this using <div> tags and some
    javascript. But to do this, it seems I need to have each <div> enclose an
    entire table instead of only a collection of rows within a table.

    Because of the above, the data I want to show is arranged in several
    tables, and these tables are set up as rows in an outer table.

    The problem I have is this: I am trying to specify the column widths so
    that all the data is aligned in all the tables. But since I have
    horizontal scrolling, the browser does not seem to use the pixel widths
    that I am giving in <td> tags. So the columns from one table do not line
    up with the columns of another.

    Does anyone know how I can force the browser to accept the pixel widths in
    this case? Alternatively, does anyone know how the data can be placed into
    one big table, but so that I can "hide" blocks of rows?

    Thanks for any help!

    Steve, Denmark
    coolsti, Sep 5, 2005
    #1
    1. Advertising

  2. coolsti

    Neredbojias Guest

    With neither quill nor qualm, coolsti quothed:

    > Does anyone know how I can force the browser to accept the pixel widths in
    > this case? Alternatively, does anyone know how the data can be placed into
    > one big table, but so that I can "hide" blocks of rows?


    It would seem to me you could id each row and javascript any combination
    of them to display:none; However, having never tried this myself, I
    could just be talking out of my food hole. Maybe I'll mess around with
    it later.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Sep 5, 2005
    #2
    1. Advertising

  3. coolsti wrote:
    > I am presenting tabular data via a web interface. The browsers are the
    > latest IE and Firefox.


    Let me be the first to say... How do you know?

    > Does anyone know how I can force the browser to...


    Yes, use Flash or Java. If you want the page to look exactly the same
    everywhere, use something that does that. You can only suggest a layout
    with html, css and scripting. (albeit almost everyone follows the
    suggestions)

    > Alternatively, does anyone know how the data can be placed into
    > one big table, but so that I can "hide" blocks of rows?


    Point to what ever rows you want to hide and do this:

    MyRowID.style.display="none";


    --
    -=tn=-
    Travis Newbury, Sep 5, 2005
    #3
  4. coolsti

    coolsti Guest

    Hi and thanks to the (so far) two replies!

    >
    > Let me be the first to say... How do you know?
    >


    Well, its a very very closed audience. It is a database application
    developed for my company. The company is small, and access to this
    application is only possible from within our intranet. We are therefore
    able to dictate which browsers this application will work on. Not to say
    that an extension to another browser would not be possible, but we are not
    in the position to consider this at the moment, nor do we need to.

    I didn't know it was possible to get a table's row to hide itself, as the
    two poster's suggest. Thanks! I will try that now!

    Regards,
    Steve
    coolsti, Sep 5, 2005
    #4
  5. coolsti a écrit :

    [snipped]

    > I want to be able to hide blocks of rows of the table when the user
    > clicks on certain icons and I can do this using <div> tags and some
    > javascript.


    [snipped]

    (...) how the data can be placed into
    > one big table, but so that I can "hide" blocks of rows?


    It's also possible for block of rows (thead, tfoot, tbody) and also
    colgroups. I strongly recommend not to use div, not to use extra tables
    or wrapping tables. You need none of that.

    Interactive demo page on table column and table row collapse and
    visibility in DOM 2 compliant browsers
    http://www.gtalbot.org/DHTMLSection/TableRowColumnCollapse.html

    DOM level 1 Dynamic table formatting
    http://www.gtalbot.org/DHTMLSection/DynamicTableFormatting.html

    2 important issues:
    - avoid border-collapsed table as much as possible because there are
    right now too many bugs to consider in current modern browsers
    - row (and/or rowgroup) collapsing is easier to code and a bit better
    supported by modern browsers than/compared to column and colgroup
    collapsing.

    Gérard
    --
    remove blah to email me
    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Sep 6, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewF
    Replies:
    1
    Views:
    740
    Bruce Barker
    Oct 10, 2005
  2. Sean Jorden
    Replies:
    1
    Views:
    584
    laurie
    Aug 19, 2003
  3. Cal
    Replies:
    1
    Views:
    521
    Tim B
    Jan 8, 2007
  4. David Basford
    Replies:
    3
    Views:
    2,386
    BootNic
    Sep 30, 2007
  5. Carl Howarth

    DG Column Width vs Table Column Width

    Carl Howarth, Oct 22, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    252
    Eliyahu Goldin
    Oct 24, 2004
Loading...

Share This Page