简体   繁体   中英

How to add auto-scroll to 'resizable' <div>?

I am using JQuery 'resizable' in a div. When I add column multiple columns to a row, it should horizontally and once out of screen space, enable the Horizontal Scroll bar.. Same with vertical scroll bar.. I need to fix a height and if it crosses the the height during multiple row addition, it should enable vertical scroll. I use the below code..

 <div id="resizable" class="ui-widget-content">
  <h3 class="ui-widget-header">Overview</h3>
         <table id="table1" class="table1">       

                <tr class="even">
                    <td>
                        <div id="rowColumn" class="rowColumn">         
                            <select id="ddlNumber" name="ddlNumber" class="ddlNumber" style="height:20px; Width:160px;" >                        
                              <option value="1">1</option>
                              <option value="2">2</option>                                  
                            </select>
                            <select id="ddlMatch" name="ddlMatch" class="ddlMatch" style="height:20px; Width:120px;" > </select>                            

                            <input type="text" id="textMatchMe" name="textMatchMe" class="textMatchMe" style="height:20px; width:140px"/>
                            <input type="text" id="textMatchMeNumber" name="textMatchMeNumber" class="textMatchMeNumber" style="height:20px; width:140px" "/>
                             <input type="button" id="btnAddColumn" name="btnAddColumn" class="addcolumn add" value="OR" style="height:auto;"/>
                        </div>
                    </td>
                </tr>               
        </table>

        <div>

            <input type="button" id="btnAddRow" name="btnAddRow" class="btnAddRow" value="AND" style="height:auto; "/>                
        </div>               
</div>

Thanks in advance..

-DK

Set a max-width and max-height.

table {
  max-width:600px;
  max-height:600px;
  overflow-y:scroll;
  overflow-x:scroll;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM