代码改变世界

css控制td中的内容不换行

2012-11-06 09:49  斌哥tobin  阅读(444)  评论(0编辑  收藏  举报

<style type="text/css">
.dt {table-layout:fixed; width:100px;}
.dt td, .dt th{white-space:nowrap;overflow:hidden;}
</style>

<table class="dt">
      <tr>
      <td>文字1文字2文字3文字4文字5文字6文字7文字文字文字</td>
      </tr>

     </table>