2015-11-03 5 views
5

私のワードラップは、文字列が破壊ではなく、1行に常にあるすべてのワードラップが機能しないのはなぜですか?

<table border="1" style="width:100%"> 
 
     <thead> 
 
      <tr> 
 
      <th>very long word</th> 
 
      </tr> 
 
     </thead> 
 
     <tbody> 
 
      <tr> 
 
      <td style="word-wrap:break-word;">ablkasd/123123123/agsdfasdf/asdfasdfasdf/_sdfsdfsdf{123123-14werwwer-14124124-wefweshtsdf-235232323}/3235235/dasasdfasdfasdf.bsfs</td> 
 
      </tr> 
 
     </tbody> 
 
    </table>

で働いていません。

私はすでにWord Wrap not working properly からすべてのソリューションを試してみましたが、それでもあなたがテーブルにを追加する必要があります

答えて

8

を働いていない:

table {width:100%; table-layout: fixed;} 
 
table td {word-wrap:break-word;}
<table> 
 
    <thead> 
 
     <tr> 
 
     <th>very long word</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 
     <tr> 
 
     <td>ablkasd/123123123/agsdfasdf/asdfasdfasdf/_sdfsdfsdf{123123-14werwwer-14124124-wefweshtsdf-235232323}/3235235/dasasdfasdfasdf.bsfs</td> 
 
     </tr> 
 
    </tbody> 
 
</table>

+1

は使いくださいクラスの代わりにインラインを提案します-styles :) –

+1

@AlexChar私は簡単にするためにOPを使用したと仮定します。しかし、あなたは正しいです、それは別にCSSを投稿するのがきれいです。 – dfsq

関連する問題