【转】给TD添加滚动条的方法
2013-06-27 22:54
337 查看
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>
例子:
<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>
相关文章推荐
- 添加滚动条的方法
- jsp中为表格添加水平滚动条的实现方法
- 添加滚动条方法
- 如何在<td></td>添加滚动条
- easyui中combobox添加滚动条的方法
- JS动态添加Table的TR,TD实现方法
- echarts柱状图、折线图横坐标添加滚动条方法
- 【Qt开发】QScrollArea添加布局后没有出现滚动条的解决方法
- JavaScript添加随滚动条滚动窗体的方法
- 运用CSS为层(div)元素添加滚动条简单而实用的方法
- 浏览器窗口滚动条特效及添加滚动条的方法
- div中添加滚动条的方法
- JavaScript添加随滚动条滚动窗体的方法
- 在 360浏览器下 position:relative; 不随着滚动条的滚动而滚动而是飘在页面上 解决方法 给父级也就是出现滚动条的元素添加 position:relative;就ok l了
- jsp中为表格添加水平滚动条的实现方法
- js固定DIV高度,超出部分自动添加滚动条的简单方法
- js固定DIV高度,超出部分自动添加滚动条的简单方法
- jsp中为表格添加水平滚动条的方法
- jsp中为表格添加水平滚动条的方法