Ok, I have a table with two rows. On the first row, I can input text in it, and when I click a button, the text automatically appears in the second row.

The problem is that when I input a text that is too long or too large for the table, then press the button, the second row will not use scrollbars, even though I use overflow:scroll and set the width and height of the td. Instead, it will make the table expand.

What is the right method to use to make the second row use scrollbars?

What version of DOCTYPE do you use? Did you put the DOCTYPE in your HTML? Use div instead of table. It will make you comfortable and solve your problem. Here is example.

HTML:
<div id="first-row">
This is the first.<a href="javascript:show()">Show content</a>
</div>
<div id="second">
This content will show when you click a link or button placed above div.
</div>

CSS:
#second {
        overflow: auto;
        height: 66px;
        max-height: 66px; /* IE ignore this declaration */
        display: block
       }

Good luck..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.