user1882705
user1882705

Reputation: 1081

Checkboxlist inside a table td breaking the text into next line in IE7

I have a checkboxlist inside a 'td' with fixed width of 160px. The checkboxlist is showing fine and taking auto with in FF,chrome,IE8 and 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>

In FF text next to checkbox for each item is showing in one line. But in IE7 some of the text breaking into next line. I tried

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

on 'td' and checkboxlist also. nothing is working. Please help.

EDIT:

<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>

Upvotes: 1

Views: 1781

Answers (1)

dragonloverlord
dragonloverlord

Reputation: 442

try `white-space: nowrap;` in css

that should fix the problem:)

For ie7 wrap your text in p tags and then add the `white-space: nowrap;` to the p tags

Upvotes: 1

Related Questions