Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to set the table inside div scrolled to bottom

Status
Not open for further replies.

Maim

Programmer
Jun 25, 1999
106
CA
I have a div with its overflow set to auto. Inside, I have a table with several rows (10) but I only ever want to show 4 rows at a time so the height of my div is 100px.

Is there a way to always have the last row showing at the bottom? If yes, then how?

sample
code
Code:
<div id=&quot;scroller&quot; style=&quot;height:100px;overflow:auto&quot;>
<table>
<tr><td>1</td></tr>
...
<tr><td>10</td></tr>
</table>
</div>

I want 10 to be visible...

Thanks

-----------------------------------
&quot;Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.&quot; - Rich Cook
 
Could you take that one row out and stick it in its own table right after the div? And then if you had to stay in that 100px height, just resize the div? That seems to be by far the easiest way.

Rick

-----------------------------------------------------------
RISTMO Designs
Arab Church
Reference Guides
 
could you just build your table bottom to top?

<div id=&quot;scroller&quot; style=&quot;height:100px;overflow:auto&quot;>
<table>
<tr><td>10</td></tr>
...
<tr><td>1</td></tr>
</table>
</div>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top