如何解決td過長的問題?css實現將固定寬度table撐開 (圖文)

來源:互聯網
上載者:User
本篇文章給大家分享的內容是關於如何解決td過長的問題?css實現將固定寬度table撐開 (圖文),內容很詳細,有需要的朋友可以參考一下,希望可以協助到你們.

解決辦法:

在table上加上樣式: 

table{table-layout:fixed;word-break:break-all}

table-layout:fixed tablle的列寬由表格寬度和列寬設定。
word-break:break-all 允許在單詞內換行。

正常情況下:

table表格中td過長:

加上樣式之後:


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.