Html 禁用文本换行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6069981/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 08:41:39  来源:igfitidea点击:

Disable text wrapping

htmlcss

提问by Neir0

Here is table with email and checkbox cells. But how i can disable textwrapping?

这是带有电子邮件和复选框单元格的表格。但是如何禁用文本换行?

Code is someting like:

代码有点像:

<table>
<tr>
<td>
<input type="checkbox" />
<td>
Dmitry soloviev ([email protected])
</tr>
...........
</table>

enter image description here

在此处输入图片说明

回答by balexandre

you should add some classes ...

你应该添加一些类...

<table class="tbl-emails">

and then

进而

.tbl-emails td { white-space: nowrap; }

回答by Layke

(Add to your CSS Selector).

(添加到您的 CSS 选择器)。

white-space:nowrap;

回答by harishtps

The white-space attribute allows you to prevent text from wrapping until you place a break
into your text.

white-space 属性允许您防止文本换行,直到您
在文本中放置一个中断。

p { white-space: nowrap; } 

回答by Algiz

You could also check the property overflow-x: http://www.w3schools.com/cssref/css3_pr_overflow-x.asp

您还可以检查属性溢出-x:http: //www.w3schools.com/cssref/css3_pr_overflow-x.asp