首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

Table 布局怎么改用CSS定位

2012-10-20 
Table 布局如何改用CSS定位以下是我的代码(已经精简了),全部用table来布局,左边是treeview控件 ,右边是一

Table 布局如何改用CSS定位
以下是我的代码(已经精简了),全部用table来布局,左边是treeview控件 ,右边是一些textbox,但是treeview因为数据的原因,会拉得很长,弄得右边的textbox每行之间的间距也是很大. 所以我要改用CSS定位,但不知道如何写呀,请高人给点提示吧,非常感谢.


<table class="style3">
  <tr>
  <td class="style4" rowspan="9">  
  <asp:TreeView ID="TreeView1" runat="server" 
  onselectednodechanged="TreeView1_SelectedNodeChanged" Width="205px" 
  BorderColor="#3399FF" 
  </asp:TreeView>
  </td>
  <td class="style5">
  <asp:Button ID="AAA" runat="server" onclick="AAA_Click" Text="分类保存" 
  Width="57px" />
  </td>  
  </tr>  
  <tr>
  <td class="style5">
  <asp:Label ID="Label2" runat="server" Text="编号"></asp:Label>
  <asp:TextBox ID="txtno" runat="server" Width="126px"></asp:TextBox>  
  </td>
  </tr>
  <tr>
  <td class="style5">
  <asp:Button ID="AB" runat="server" onclick="AB_Click" Text="保存" 
  UseSubmitBehavior="False" Width="75px" />
  </td>
  </tr>
  <tr>
  <td class="style5">
  <asp:Label ID="Label6" runat="server" Text="设备归类"></asp:Label>
  <asp:TextBox ID="txfi01" runat="server" Width="61px" ReadOnly="True"></asp:TextBox>
  <asp:Label ID="Label5" runat="server" Text="设备编号"></asp:Label>
  <asp:TextBox ID="txno" runat="server" Width="147px"></asp:TextBox>  
  <asp:Label ID="Label7" runat="server" Text="规格型号"></asp:Label>
  <asp:TextBox ID="txfi02" runat="server" Width="158px"></asp:TextBox>  
  </td>
  </tr>
  <tr>
  <td class="style5">
  <p>
  <asp:Label ID="Label9" runat="server" Text="使用部门"></asp:Label>
  <asp:TextBox ID="txfi06" runat="server" Width="101px"></asp:TextBox>
  <asp:Label ID="Label10" runat="server" Text="状态"></asp:Label>
  <asp:DropDownList ID="txfi07" runat="server" Width="100px">
  </asp:DropDownList>
  <asp:Label ID="Label11" runat="server" Text="备注"></asp:Label>
  <asp:TextBox ID="txfi08" runat="server" Width="447px"></asp:TextBox>
  </p>
  </td>
  </tr>  
   
  </table>


[解决办法]
用嵌套表格来布局呀。
------解决方案--------------------


DIV多好啊 你不用
[解决办法]
给TreeView 加一个div容器;css设置div的高度,比如你那个table的9个row的高度;设置overflow:scroll;这样不管treeview 数据多少,总会有条形吧出来,就不会把table撑大了。
[解决办法]
LZ该学下DIV了
[解决办法]
不知道你的css怎么写的啊
给个例子,需要您照猫画虎写在TreeView 上,截取一部分
width:205px;
white-space:nowrap;
word-break:keep-all;
overflow:hidden;
text-overflow:ellipsis;

热点排行