Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
HTML のデータを含むテーブルがいくつかあります。列幅を (できれば CSS を使用して) 動的に設定して最長の値に合わせる方法を見つけようとしていますが、比較すると非常に長いため、列ヘッダーをワードラップしたいと考えています。
たとえば、私は
Percentage of Items purchased 40% 60% 30%
列の幅を 40%、60%、30% の値に合わせ、「購入したアイテムの割合」をワードラップしたいと思います。
スタイルシートに次を追加します。
white-space:nowrap;あなたTDにではなく、あなたにTH。
white-space:nowrap;
TD
TH