SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: help needed

  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Location
    Texas
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question help needed

    I have some tabular data (like an address book) currently contained in a table, but the table is getting tooooo long.

    Here's what I want to do:
    1) I want a window with automatic scrollbars when the width or height of the table exceeds the dimensions of the window.
    2) Obviously the next step is to be able to position the tabular data via the scrollbars.
    3) This data is best viewed as a table, so that's how I want to appear.
    4) I want to single-click in any row and select the whole row. The row selection must work like a radio button (i.e. only one row can be selected at any time) so that when a different row is selected, the previous row gets deselected.
    5) Finally, just like in a Form, I'd like to press the Submit button and read each selected column from the $_POST array.

    My idea on the selection process (step 4) is that when a row is clicked, each table row element could somehow be morphed into a Form textbox. Then when the submit button is pushed, the $_POST array will be filled automatically. But I can't figure out how to do the scrollable window.

    Am I dreaming, or can this be accomplished using XHTML and PHP?
    awolbush

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    As far as the scrollable window, put the entire table into a block-level element, such as a div. Give that element a width, height, and "overflow: scroll" styles.

  3. #3
    SitePoint Member
    Join Date
    Apr 2009
    Location
    Texas
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I looked up the overflow attribute and got the scrolling to work. The only peculiarity is that the scrollbars will not appear unless I have the <fieldset> and <legend> tags present in the form. However, now I want more. I have a heading row in my table with column legends (from mysql). How can I scroll everything horizontally (already does this) but only scroll the body rows vertically? Is there any way of locking the header row vertically like you can do in Excel?

    I think for the selection process, I'm going to try to add a narrow column on the left and put a radio button in there for each row.

    awolbush


Bookmarks

Posting Permissions

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