【轉】給TD添加滾動條的方法


TD本身不允許出現滾動條,而會總動撐大,所以要想加滾動條需要另外在TD內添加一個容器如:DIV。

例子:

<table style="width: 450px; height: 360px">
            <tr>
                <td valign="top" style="border:solid 1px gray"><div style="overflow-y:scroll;height:330px;">
                    <asp:TreeView ID="TreeView1" runat="server" ExpandDepth="1" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged" ShowCheckBoxes="None" ShowLines="true">
                    </asp:TreeView></div>
                </td>
                <td valign="top" style="border:solid 1px gray;"><%--<div style="overflow-y:scroll;height:330px;">--%>
                    <br />
                    <asp:Label ID="Label1" runat="server" Text="請選擇人員:"></asp:Label><br />
                    <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto" Height="300px">
                        <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                        </asp:RadioButtonList>
                    </asp:Panel>
                    <%--</div>--%></td>
            </tr>
            <tr>
                <td align="center" colspan="2" valign="top" style="height: 30px">
                    <input id="Button1" type="button" value="確定" onclick="goback();" /></td>
            </tr>
        </table>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM