[英]Wraping text within a table's td
I am working on trying to clean up a customers evaluation software. 我正在努力清理客户评估软件。 In this example, the text doesn't wrap within the box. 在此示例中,文本不包装在框中。 Adding a fixed size to the table doesn't help, as the information called from the SQL database just places it on top with no warping. 在表中添加固定大小无济于事,因为从SQL数据库调用的信息只是将其放在顶部而不会发生扭曲。
<tr>
<td valign="bottom" align="center"><br />
<table style="background-color: #EFEFEF; box-shadow: 5px 5px 5px #999; table-layout:fixed; width:400px" border=1 rules=none frame=box cellpadding="5">
![enter image description here][1]<tr><td width=250px height="90px" valign="top"><pre>' . base64_decode($eval['note']) . '</pre></td></tr>
</table>
</td>
</tr>
What steps should I look at doing or code should I add to fix this formatting error? 我应该看什么步骤或应该添加代码来解决此格式错误? Attached is a screen shot of the UI. 随附的是UI的屏幕截图。
Thank you, 谢谢,
Paul 保罗
You are inserting your data inside a <pre> block, effectively telling the browser not to wrap the text. 您正在将数据插入<pre>块内,有效地告诉浏览器不要包装文本。 I assume you do this so that literal newlines in the 'note' data are indeed printed. 我假设您这样做是为了确实打印“注释”数据中的文字换行符。
To alter wrapping space-characters and newline functionality of an element, you can use the CSS white-space property. 要更改元素的换行符和换行功能,可以使用CSS空白属性。 So, to get what you want (both wrapping AND literal newlines), you can set white-space to either pre-line or pre-wrap, depending on your need. 因此,要获得所需的内容(包括换行和文字换行符),可以根据需要将空格设置为预行或换行。 Eg. 例如。 change the <pre> to 将<pre>更改为
...<pre style="white-space:pre-wrap;">' . base64_decode($eval['note']) . '</pre>...
See the reference for more details 有关更多详细信息,请参见参考
Good luck, 祝好运,
bob 鲍勃
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.