[nflug] Off Topic - Freezing HTML Table Column

joshj at linuxmail.org joshj at linuxmail.org
Wed Aug 16 11:05:24 EDT 2006


When we last left our adventurers...

> Sorry for the off topic post.  But I know some guys here do some Web work.
>
> What I'm looking for is a simple way to freeze a column on an html table (or 
> equivalent) so that when the user scrolls, that column follows. It's for 
> proofing a large dump of data from a database using PHP.
>
> Basically the first column is 'Item Number' and there is 40 or so other 
> columns to the right. It's in just an HTML table now, and as the user scrolls 
> with the browsers scroll bar to see more columns on the right, the item 
> number obviously scrolls out of sight on the left.
>
> I know there all all kinds of complex DHTML plugins and things that can do 
> this, I'm just looking for a simple solution.

There's really no simple way to do it. The following would work. But 
you'll probably run into formatting problems (which you could probably 
circumvent by setting the height of each individual <td>:

     <table>
       <tr>
         <td valign="top">

     <table border="1" cellspacing="1" cellpadding="5">
       <tr>
         <td>
           ID
         </td>
       </tr>
       <tr>
         <td>
           100
         </td>
       </tr>
       <tr>
         <td>
           200
         </td>
       </tr>
       <tr>
         <td>
           300
         </td>
       </tr>
     </table>
         </td>
         <td valign="top">
     <div style="width:300px;overflow:auto;">
     <table border="1" cellspacing="1" cellpadding="5">
       <tr>
         <td>
           ID
         </td>
       </tr>
       <tr>
         <td>

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
         </td>
       </tr>
       <tr>
         <td>

BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
         </td>
       </tr>
       <tr>
         <td>

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
         </td>
       </tr>
     </table>
     </div>

         </td>
       </tr>
     </table>


Off-hand, I can't think of a reasonably sane way to do this in html. If 
dumping it into a spreadsheet is an option then you can freeze the 
rows/cols.

-Josh

>
> Thanks
> Justin
>
>
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list