表格内的复选框列表将文本分成IE7中的下一行

时间:2013-04-17 14:32:42

标签: html css html-table

我在'td'里面有一个复选框,固定宽度为160px。复选框列表显示正常,并在FF,chrome,IE8和IE9中使用自动

    <table border="1" cellspacing="0" cellpadding="0">
          <tr>

            <td style="width:160px;"> 
              <label class="tdLabel">my chekcbox:</label><br />
              <asp:CheckBoxList id="chk1" AutoPostBack="True" EnableViewState="true" CellPadding="5" CellSpacing="5"
                                RepeatColumns="1" RepeatDirection="Horizontal" RepeatLayout="Flow" runat="server" OnSelectedIndexChanged="chk1_SelectedIndexChanged">
              </asp:CheckBoxList>
           </td>
</tr>
</table>

在每个项目的复选框旁边的FF文本中显示一行。但是在IE7中的一些文字突破了下一行。我试过了

float:left
text-align:left
clear:both
display:inline

在'td'和checkboxlist上也是。什么都没有用。请帮忙。

编辑:

<td style="width:160px;white-space: nowrap;"> 
          <label class="tdLabel">my chekcbox:</label><br />
          <span id="xxxx"><input id="ctl00_ctl00_ContentPlaceHolder4_ContentPlaceHolder2_chk1_0" type="checkbox"  /><label >Paln text1 goes here</label><br /><input id="ctl00_ctl00_ContentPlaceHolder4_ContentPlaceHolder2_chk1_1" type="checkbox"  /><label >Paln text2 goes here</label>

1 个答案:

答案 0 :(得分:1)

尝试`white-space:nowrap;`在css中

应解决问题:)

对于ie7将文本包装在p标签中,然后将`white-space:nowrap;`添加到p标签