2017-06-01 4 views
0

<td>要素内にテキストを折り返す必要がありますが、table-layoutプロパティを使用することはできません。出力はhtml電子メール本文になり、Outlookはtable-layoutプロパティをサポートしません。テーブルレイアウトのないテーブルデータのラッピング?

<td>要素内にテキストを折り返す別の方法がありますか、コードの改行と測定を手動で行う必要がありますか?ここで

私はacheiveしようとしているものの例である:

td { 
 
    border: solid black 1pt; 
 
    font-family: arial; 
 
    font-size: 10pt 
 
} 
 

 
thead td{ 
 
    text-align:center; 
 
    font-weight:bold; 
 
} 
 

 
table { 
 
    border-collapse: collapse 
 
}
<html> 
 

 
<body> 
 
    <table style="width:35pt;height:24pt;table-layout:fixed"> 
 
    <thead> 
 
     <tr> 
 
     <td style="width:35pt;height:12pt">Good</td> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 
     <tr> 
 
     <td style="width:35pt;height:12pt;word-wrap:break-word">Costingly Cost Cost</td> 
 
     </tr> 
 
    </tbody> 
 
    </table> 
 
    
 
    <div style="height:50pt"></div> 
 

 
    <table style="width:35pt;height:24pt;"> 
 
    <thead> 
 
     <tr> 
 
     <td style="width:35pt;height:12pt">Bad</td> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 
     <tr> 
 
     <td style="width:35pt;height:12pt" nowrap>Costingly Cost Cost</td> 
 
     </tr> 
 
    </tbody> 
 
    </table> 
 
</body> 
 

 
</html>

+0

このメソッドにはtry:[HTML TD wrap text](https://stackoverflow.com/questions/1057574/html-td-wrap-text)を指定します。私は電子メールではなく、一般的なテーブルを知っています。 – Syfer

+0

残念ながら、これは良いことではありません。提案されたすべてのソリューションは、 'table-layout'または' max-width' CSSプロパティのどちらかを使用していました。どちらもOutlookでサポートされていません。 –

+0

これはメールのためのものです:https://stackoverflow.com/questions/10096012/break-long-words-in-html-email-in-outlook-2010 – Syfer

答えて

1

Microsoft独自の単語を使用します-break:ブレークオール。

<td style="word-break:break-all;"> 

これで解決するはずです。

+1

これを読んでいる人のために、私は ''となってしまい、OutlookとGmailの両方で正しいラッピング動作ができませんでした私はまだ他のクライアントとテストしていません)。 –

+0

ありがとうKありがとうございます:-) – Syfer

0

あなたがこの試すことができます:

<tr> 
<td nowrap>Never increase, beyond what is necessary, the number of entities required to explain anything</td> 
<td>Never increase, beyond what is necessary, the number of entities required to explain anything</td> 

+0

残念ながら、これはうまくいきません。テキストは折り返しますが、単語の区切りで折り返され、 '​​'要素の幅を広げることができます。 'table-layout:fixed'と' word-wrap:break-word'を使用すると、 '​​'の幅を維持したまま正しい折り返しが得られます。具体的な質問にサンプルスニペットを追加します。 –

関連する問題