Setting Row of Table in viewport

Discussion in 'HTML' started by Mel Smith, Jun 4, 2009.

  1. Mel Smith

    Mel Smith Guest

    Hi:

    How does one set the row of a long table (> 600 rows) to be visible in
    the viewport.

    btw, I have complete control of the table itself and can alter its
    contents just prior to sending it out via my Apache server.

    Thank you.

    Mel Smith
     
    Mel Smith, Jun 4, 2009
    #1
    1. Advertising

  2. Mel Smith wrote:

    > How does one set the row of a long table (> 600 rows) to be
    > visible in the viewport.
    >
    > btw, I have complete control of the table itself and can alter its
    > contents just prior to sending it out via my Apache server.


    So why don't you simply make it send that one row (a one-row table)?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jun 4, 2009
    #2
    1. Advertising

  3. Mel Smith

    Mel Smith Guest

    "Jukka K. Korpela" <> wrote in message
    news:s6VVl.9640$...
    > So why don't you simply make it send that one row (a one-row table)?


    Jukka:

    This document is an online telephone book for the 613 residents of our
    Senior Park.

    The user has an option to 'Edit' his phone information. When he 'clicks'
    on the Edit Button in his <tr><td> element, I present another page where I
    input all his changes. On submission, I then change the phone database, and
    then wish to re-send the complete 613-row updated telephone directory to him
    to show these changes -- *but* with focus on *his* row of the directory (so
    he doesn't have to page down and find his name again).

    Thank you.

    -Mel Smith
     
    Mel Smith, Jun 4, 2009
    #3
  4. Mel Smith wrote:
    > "Jukka K. Korpela" <> wrote in message
    > news:s6VVl.9640$...
    >> So why don't you simply make it send that one row (a one-row table)?

    >
    > Jukka:
    >
    > This document is an online telephone book for the 613 residents of our
    > Senior Park.
    >
    > The user has an option to 'Edit' his phone information. When he 'clicks'
    > on the Edit Button in his <tr><td> element, I present another page where I
    > input all his changes. On submission, I then change the phone database, and
    > then wish to re-send the complete 613-row updated telephone directory to him
    > to show these changes -- *but* with focus on *his* row of the directory (so
    > he doesn't have to page down and find his name again).


    Now I can see how the sentence in your original post means that, but it
    wasn't at all clear to me that that's what you meant.

    The answer:

    <tr><td>A row</td><td>...</td></tr>
    <tr><td>Another row</td><td>...</td></tr>
    <tr><td>Another row</td><td>...</td></tr>
    <tr><td id="therow">THE row</td><td>...</td></tr>

    If the URL for the page is blah, use blah#therow instead.
     
    Harlan Messinger, Jun 4, 2009
    #4
  5. Mel Smith wrote:

    > This document is an online telephone book for the 613 residents of
    > our Senior Park.


    Telephone books don't make good web pages. It's better to create a user
    interface (form) for querying data in a telephone catalog, returning just
    the entries that match the query.

    > The user has an option to 'Edit' his phone information. When he
    > 'clicks' on the Edit Button in his <tr><td> element, I present
    > another page where I input all his changes.


    That's a clumsy user interface.

    > On submission, I then
    > change the phone database, and then wish to re-send the complete
    > 613-row updated telephone directory to him to show these changes --


    Sounds weird. It's hardly efficient, but that's not the main point. The
    point is that one should be able to edit one's own data without even seeing
    other people's data.

    > *but* with focus on *his* row of the directory (so he doesn't have to
    > page down and find his name again).


    Well, that's something different from showing (only) the particular row in
    the viewport, isn't it?

    Is this really about _focus_? Anyway the answer is that you cannot set focus
    in HTML, and you could set it in JavaScript, with the usual caveats, but
    most browsers let you set focus on some elements only, such as form fields
    and links.

    Moreover, there is no guarantee that the focused element is shown in the
    viewport.

    The best shot might be to put a link (possibly a dummy link) in a cell of
    the row and focus on the link, e.g.

    <tr><td><a href="#my" id="my">foobar</a><td> ...

    with

    <script type="text/javascript">
    document.getElementById('my').focus();
    </script>

    and optionally with a stylesheet that tries to prevent the link from looking
    like a link... doing just the opposite of good link design, that is. :)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jun 4, 2009
    #5
  6. Mel Smith

    Mel Smith Guest

    Jukka & Harlan:

    Thanks for both your responses. I'll puzzle on them both, and then do
    something about the problem

    -Mel Smith

    >
     
    Mel Smith, Jun 5, 2009
    #6
  7. Mel Smith

    richard Guest

    On Thu, 4 Jun 2009 12:35:12 -0600, "Mel Smith"
    <> wrote:

    >Hi:
    >
    > How does one set the row of a long table (> 600 rows) to be visible in
    >the viewport.
    >
    > btw, I have complete control of the table itself and can alter its
    >contents just prior to sending it out via my Apache server.
    >
    > Thank you.
    >
    >Mel Smith
    >


    You might want to consider doing this in PHP. A server side script
    could handle this problem easier.

    Instead of listing all 600 plus items, list them in smaller groups.
    Assuming you have somewhat of "streets" in your park, you could list
    the names according to the street.
     
    richard, Jun 5, 2009
    #7
  8. Mel Smith

    Mel Smith Guest

    "richard" <> wrote in message
    news:...
    > On Thu, 4 Jun 2009 12:35:12 -0600, "Mel Smith"
    > You might want to consider doing this in PHP. A server side script
    > could handle this problem easier.
    >
    > Instead of listing all 600 plus items, list them in smaller groups.
    > Assuming you have somewhat of "streets" in your park, you could list
    > the names according to the street.


    Richard:

    Some explanatory notes and corrections:

    - My phonebook is two columns (in the general sense) wide, with the
    Names (plus phone numbers, addresses, lot numbers, etc, etc). in
    alphabetical order left-to-right, and top-to-bottom.

    - In the viewport in full-screen, nearly six phone/name entries are
    displayed (with a slider on the right side of the viewport for a resident to
    view all the other residents), and also a button (in his *own* entry) to
    allow him to edit his own demographic information (some of which does not
    display in the online phone book)

    - Since we have a set amount of 613 homesites and homes, I then have
    307 'blocks' of resident information arranged in two columns.

    - Since I am a long-time commercial business application developer in
    Windows, and have expertise in database systems (CDX Databases mostly), I
    create / modify / send all my pages from a C-based language (see
    www.xharbour.com). I run my own apache server right beside me in my home
    office. I have a very limited knowledge of web page design going back only
    five months

    - Since I'm networked with my apache server beside me, it is normal
    for me to send updates to the server many times each day for testing and
    trials.

    My Problem:

    - The residential data is badly out-of-date (e.g.,home summer
    caretakers have been dead for years, emergency phone numbers are badly
    out-of-date, etc). The Park Office puts out a hard copy of the Phone Book
    yearly, but it has wrong information in many places. Only the homeowner
    himself *really* knows the correct information.

    - I wish the homeowner (or one of his computer knowledgeable friends)
    to access the online directory, move to his entry in the table, 'click' on
    this EDIT button, get my input page, and modify his demographic data, submit
    it to me, where I'll verify it (with my C-based CGI program), and place it
    in my datasbase, and quickly re-build the basic resident directory page
    (about 3/4 of a second).

    - THEN, I want to send the corrected phonebook page back to him *and*
    position the long table so that *his* entry is in the viewport, and he can
    see that he made the proper changes.

    (btw, this morning I tried to use the following:

    <body onload="window.document.getElementById('lot318').focus();">

    (and deep in the body I had <input type="submit", id="lot318",
    value="EDIT> , etc, etc)

    but when I viewed the page with explorer it didn't move down the
    viewport to this entry. Sigh ...

    Sorry for this long harangue.

    Thanks for your suggestion.

    -Mel Smith
     
    Mel Smith, Jun 5, 2009
    #8
  9. Mel Smith

    Mel Smith Guest

    Re: Setting Row of Table in viewport (to Richard)

    Richard:

    I tried to send you a .png image of the phone directory viewport, but
    your email bounced.

    -Mel Smith
     
    Mel Smith, Jun 5, 2009
    #9
  10. Mel Smith

    richard Guest

    Re: Setting Row of Table in viewport (to Richard)

    On Fri, 5 Jun 2009 10:32:40 -0600, "Mel Smith"
    <> wrote:

    >Richard:
    >
    > I tried to send you a .png image of the phone directory viewport, but
    >your email bounced.
    >
    >-Mel Smith
    >



    Which is precisely why I use that addy.
    Even though it is not mine and valid, I have permisson to use it.
    I generally do not post my real addy to usenet.

    But don't really be looking to me for your solution as I am not all
    that much of a web designer or builder. I'm just an average tinkerer.

    You should look into using php or perhaps even looking at a cgi
    script. As I said, I would cut down the size of how many names are
    displayed, then just link to the other pages.
     
    richard, Jun 5, 2009
    #10
  11. Mel Smith

    richard Guest

    Re: Setting Row of Table in viewport (to Richard)

    On Fri, 5 Jun 2009 10:32:40 -0600, "Mel Smith"
    <> wrote:

    >Richard:
    >
    > I tried to send you a .png image of the phone directory viewport, but
    >your email bounced.
    >
    >-Mel Smith
    >


    One other thing you might do is to post the url so I and others can
    take a look and better help understand your problem.

    As you have the server close at hand, you might want to take a look at
    www.runbasic.com
    This is a fairly simple programming language based on "Liberty Basic"
    which has been designed primarily for use on home based systems, but
    can be installed on full servers. It is kind of a mix between php and
    the old "BASIC" language but upgraded for use in web development.

    With your problem, you could easily write a small program that would
    allow users to update information without to many hassles.

    I have runbasic installed on my web server.
    http://www.1littleworld.net/truck1.html
    A simple program I wrote.
     
    richard, Jun 5, 2009
    #11
  12. Mel Smith

    Mel Smith Guest

    Re: Setting Row of Table in viewport (to Richard)

    >
    > One other thing you might do is to post the url so I and others can
    > take a look and better help understand your problem.
    >
    > As you have the server close at hand, you might want to take a look at
    > www.runbasic.com
    > This is a fairly simple programming language based on "Liberty Basic"
    > which has been designed primarily for use on home based systems, but
    > can be installed on full servers. It is kind of a mix between php and
    > the old "BASIC" language but upgraded for use in web development.
    >
    > With your problem, you could easily write a small program that would
    > allow users to update information without to many hassles.
    >
    > I have runbasic installed on my web server.
    > http://www.1littleworld.net/truck1.html
    > A simple program I wrote.


    Richard:

    As I mentioned on a previous post, I have expertise (19 years) in
    programming business apps. The package I use (www.xharbour.com) is more
    powerful than a train and faster than a speeding bullet :)) So, I'll
    continue using the Extended Harbour language (xHarbour)

    Since I use xHarbour every day, and build apps big and small veery
    often, I'll continue to use this language to continue building my CGI app.

    btw,

    Another helpful person in another ng suggested the following (which I'll
    try this afternoon)

    var
    row=document.getElementById('tableid'):rows[rowIndex].scrollIntoView(true);

    Thanks for the further comments

    -Mel Smith
     
    Mel Smith, Jun 5, 2009
    #12
  13. Mel Smith

    Mel Smith Guest

    Solved !

    Hi: Jukka, Martin & Richard:

    My last post resulted in my solving the problem:


    Here is the solution:

    <body
    onload="document.getElementById('myLotNumberEditButton').scrollIntoView();">

    When this statement is placed in my Phone BookPage, the Viewport immediately
    displays the required 'block' of resident information.

    Thank you all for helping !

    -Mel Smith
     
    Mel Smith, Jun 5, 2009
    #13
  14. Mel Smith

    richard Guest

    Re: Solved !

    On Fri, 5 Jun 2009 13:04:20 -0600, "Mel Smith"
    <> wrote:

    >Hi: Jukka, Martin & Richard:
    >
    > My last post resulted in my solving the problem:
    >
    >
    >Here is the solution:
    >
    ><body
    >onload="document.getElementById('myLotNumberEditButton').scrollIntoView();">
    >
    >When this statement is placed in my Phone BookPage, the Viewport immediately
    >displays the required 'block' of resident information.
    >
    >Thank you all for helping !
    >
    >-Mel Smith
    >


    You might want to check that on various browsers for accuracy.
     
    richard, Jun 6, 2009
    #14
    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. Peter

    JTable viewport

    Peter, Oct 20, 2003, in forum: Java
    Replies:
    10
    Views:
    1,472
    Peter
    Oct 22, 2003
  2. Charles Packer
    Replies:
    2
    Views:
    803
    Sudsy
    Nov 5, 2003
  3. Csaba Gabor

    Pic and Viewport design question

    Csaba Gabor, Mar 22, 2005, in forum: HTML
    Replies:
    11
    Views:
    736
  4. phl
    Replies:
    1
    Views:
    4,377
    Martin Jay
    Jun 8, 2006
  5. D
    Replies:
    0
    Views:
    230
Loading...

Share This Page