user1943020
user1943020

Reputation:

How can I avoid words wrapping in my table <td> cells?

I have a table that is too big for my page. What I wanted was to get scroll bars but what happens is the words in a <td> wrap around onto the next line. Is there a way I can stop the words wrapping so that the table gets big and the scroll bars appear?

Note I already enclosed my table in a overflow-x: auto div.

Upvotes: 2

Views: 95

Answers (2)

busyPixels
busyPixels

Reputation: 375

To do it with css you would use:

 white-space: nowrap;

This forces it to stay on one line.

Ex: http://jsbin.com/EsenUCI/1/edit?html,css,output

Upvotes: 0

James Sefton
James Sefton

Reputation: 133

You could add the nowrap flag to your td tag. There is probably a css version (which would be a more modern way to do it)

eg:

<td nowrap>text text text</td>

Upvotes: 2

Related Questions