It's not a secret anymore!
The moose likes HTML, CSS and JavaScript and the fly likes Dynamically increasing DIV size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Dynamically increasing DIV size" Watch "Dynamically increasing DIV size" New topic

Dynamically increasing DIV size

Reshmi Kuttappan

Joined: May 26, 2009
Posts: 17

am having difficulty while implementing DIV tags in my HTML.

Scenario is as follows:
1: am having a table with 19 columns, having 2 rows for header fields <th> & 2 rows for data fields <td>
2: have used a Div tag with following properties to show all columns using a scrollbar.
<div style=" width:932px; height:125px; overflow:auto;" id="divAcc">
3: i have a function on click of which am populating the 2 rows of data fields <td>. (Note: Every time the button is clicked point 3 must happen. User can click the button 'n' number of times)

Now the problem arised here:
1: On button click am able to populate 2 rows of data, but since my DIV size is not getting increased all values appear on the scroll bar.

Please help me to dynamically increase my DIV height.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Because you have the div set to scroll, you add rows to the bottom of the table and it will appear hidden.

Add the rows to the top or scroll the div down to where you just added the rows.

I agree. Here's the link:
subject: Dynamically increasing DIV size
It's not a secret anymore!