UPDATE: The below question is still valid, but I tested my page in Chrome and it works as expected. When I hit the page in IE it does not wrap. I will now start researching this difference. Let me know if you know of the IE fix for this. Thanks
I have an asp:TextBox that will not wrap. I've run across multiple articles that say I must have TextMode="MultiLine" Wrap="True"
, and I do, but my text still runs out of the text box.
I don't think I need to post the full page, but tell me if I do. Here's my asp:TextBox, and the CSS class acting on the <TD>
. Please let me know if you see why my text is not wrapping?!
<td class="auto-style130" >
<asp:TextBox ID="lbl_pain1_drug" Width="400px" runat="server" Rows="4"
TextMode="MultiLine" Wrap="True" ReadOnly="true" BorderStyle="None"
BorderWidth="0" Font-Names="Tahoma" Height="55px"
style="overflow:hidden" >
</asp:TextBox>
</td>
Here is the class="auto-style130"
.auto-style130 {
/*sig section of script*/
border: .1px solid #808080;
word-wrap: break-word;
word-break: break-all;
height: 50px;
width: 402px;
vertical-align: middle;
}
Here is the article where I found the solution, it basically says the newest IE browsers handle textbox wrapping just a little different than they used to. The solution was to add white-space: pre-wrap;
my CSS. Here's what new block looked like:
.auto-style130 {
/*drug section of script*/
border: .1px solid #808080;
white-space: pre-wrap;
height: 35px;
width: 402px;
vertical-align: middle;
}
This made everything wrap!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With