white-space: nowrap;
Browser |
|
---|
The white-space property sets how white space (spaces and line breaks) is handled.
The automatic text wrapping for the cells can be disabled by applying this property to the TD or TH element.
#example {
white-space: nowrap;
}
Property | Value | Explanation |
---|---|---|
white-space | nowrap | disables automatic text wrapping |
- sets how white space is handled
(Other values can be seen)
Example
<html>
<head>
<title>TAG index</title>
<style type="text/css">
table, td { border: 2px #2b2b2b solid; }
table { width: 300px; }
#example { white-space: nowrap; }
</style>
</head>
<body>
<table>
<tr>
<td id="example">Disables automatic text wrapping.</td>
<td>Preserves automatic text wrapping.</td>
</tr>
</table>
</body>
</html>
- Output
-
Disables automatic text wrapping. Preserves automatic text wrapping.