white-space: nowrap;

  • IE
  • Cr
  • Sf
  • Fx
  • O

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


<title>TAG index</title>

<style type="text/css">

table, td { border: 2px #2b2b2b solid; }
table { width: 300px; }

#example { white-space: nowrap; }



<td id="example">Disables automatic text wrapping.</td>
<td>Preserves automatic text wrapping.</td>


Disables automatic text wrapping. Preserves automatic text wrapping.