2012-05-15 24 views
2

我正在使用CheckBoxList,如果值超過div標籤寬度,則複選框標籤顯示在下一行。如果標籤的寬度超過Div標籤的限制,則在下一行顯示覆選框標籤

有沒有一種方法可以在同一條線上對齊?

<table id="Table1"> 
        <tr> 
         <td width="250px"> 
          <asp:Label ID="deleteLabel" runat="server" Text="Select "></asp:Label> 
         </td> 
         <td width="900px"> 
          <div style="border-style: solid; border-color: inherit; border-width: thin; overflow: auto; 
           width: 356px; height: 100px" class="ccodes" runat="server" id="deletePanel1"> 
           <asp:CheckBox ID="CheckBoxSelectAll" runat="server" Text="All" /> 
           <asp:CheckBoxList ID="checkBoxListDeleteEntities" runat="server" RepeatDirection="Vertical" 
            Height="26px"> 
           </asp:CheckBoxList> 
          </div> 
         </td> 
        </tr> 
    </table> 

值顯示如下所示。 (第三值如果超過div的寬度(356px))

[] test1 
[] test2 
[] 
test test test test test test test test test test test test test 

任何建議如何使複選框複選框標籤內嵌?

回答

2

你試過white-space: nowrap

.nowrap_list tr td label 
{ 
    white-space:nowrap; 
    overflow:hidden; 
} 

<asp:CheckBoxList ID="checkBoxListDeleteEntities" 
    CssClass="nowrap_list" 
    runat="server" RepeatDirection="Vertical" 
    Height="26px"> 
</asp:CheckBoxList> 
+0

不,我會試試看:) –