Re: [問題] td寬度的問題
※ 引述《zxvc (眾生都是未來佛)》之銘言:
: 有個4 columns的table,其中1, 3 columns是nowrap,如下:
: <table>
: <tr>
: <td style="white-space:nowrap">foo</td>
: <td>foo</td>
: <td style="white-space:nowrap">foo</td>
: <td>foo</td>
: </tr>
: </table>
: 我想讓1, 2 columns一組,然後3, 4 columns一組,
: 並且這兩組各佔50%的頁面width,請問要如何做?
雖然不確定以下是否完全滿足我以上的要求,
不過目前我已很滿意這個結果:
<table style="table-layout:fixed;width:100%">
<tr>
<td style="width:5em">foo</td>
<td style="word-wrap:break-word">foo</td>
<td style="width:5em">foo</td>
<td style="word-wrap:break-word">foo</td>
</tr>
</table>
我想關鍵在table-layout:fixed與word-wrap:break-word。
--
楞嚴咒(附注音):
https://skydrive.live.com/?cid=87cef5e6683b5427&sc=documents&id=87CEF5E6683B5427%21312#
縮址:
http://bit.ly/r3bgEo
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.220.54
※ 編輯: zxvc 來自: 140.115.220.54 (11/19 08:52)
→
11/19 08:52, , 1F
11/19 08:52, 1F
※ 編輯: zxvc 來自: 140.115.73.148 (11/19 10:42)
→
11/19 10:43, , 2F
11/19 10:43, 2F
→
11/19 10:46, , 3F
11/19 10:46, 3F
→
11/19 10:48, , 4F
11/19 10:48, 4F
→
11/19 10:48, , 5F
11/19 10:48, 5F
討論串 (同標題文章)