How to prevent line-break in a column of a table c

2019-01-22 00:26发布

How can I prevent automatic line breaks in a column of table (not a single cell)?

标签: html css layout
9条回答
Viruses.
2楼-- · 2019-01-22 01:23

For completion sake:

#table_id td:nth-child(2)  {white-space: nowrap;}

Is used for applying a style to the 2 column of the table_id table.

This is supported by all major Browsers, IE started supporting this from IE9 onwards.

查看更多
3楼-- · 2019-01-22 01:27

Just add

style="white-space:nowrap;"

Example:

<table class="blueTable" style="white-space:nowrap;">
   <tr>
      <td>My name is good</td>
    </tr>
 </table>
查看更多
啃猪蹄的小仙女
4楼-- · 2019-01-22 01:33

Put non-breaking spaces in your text instead of normal spaces. On Ubuntu I do this with (Compose Key)-space-space.

查看更多
登录 后发表回答