Reputation: 2087
I am trying to make a table in HTML. When I resize the window down to be narrow and the window tries to squash everything to fit inside the window even though it's narrow, it puts the contents of a cell on different lines. I don't want this to happen. E.g.:
home about contact us
when you narrow down the browser window:
home about contact
us
This is really annoying. I have tried putting
instead of a space where the space is, but it didn't help. Does anyone know the solution?
Upvotes: 4
Views: 262
Reputation: 18364
What do you expect?
Say the window becomes smaller so that the cell also becomes smaller than to fit contact us
completely, then do you expect The "extra" content to be hidden? The size of the cell never become smaller than a fixed-minimum?
You need to use width
ad height
along with overflow
(overflow). overflow:hidden
will hide the content that is more than the width
(provided a height
is given)
Upvotes: -1
Reputation: 3935
Try adding CSS attribute of white-space to the <td>
elements of the table. In particular, <td style='white-space: no-wrap;'>
Upvotes: 1
Reputation: 9078
You can use
for this. That way the browser sees it as one word.
Upvotes: 1