我有一个多行文本框
<asp:TextBox ID="txtdsISTaddress" runat="server" TextMode="MultiLine" Rows="3" MaxLength="4000"></asp:TextBox>
基于那个文本框,我打印了一个这样的 html
<tr>
<td>
<asp:Label ID="lbladd" runat="server" Text="Address:"></asp:Label>
<asp:Label ID="lbladdval" runat="server"></asp:Label>
</td>
</tr>
如果我中断并在多行文本框中输入数据,一切都很好,但如果我不中断,我的打印页面中会出现水平滚动条。如何阻止这个?它应该自动中断而不创建水平滚动条。
最佳答案
您可以像这样为 TextBox
添加 CSS style
属性作为 word-wrap
;
<asp:TextBox ID="txtdsISTaddress" runat="server" TextMode="MultiLine" Rows="3" MaxLength="4000" style = "word-wrap: break-word;"></asp:TextBox>
关于c# - 多行文本框打断字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47509586/