我已經看過這個問題了很多次,但還沒有看到答案。有沒有辦法使用div和css而不是表格複製下面的行爲?寧願沒有JavaScript。「橡皮條」部分僅在腳註中用css
http://jsfiddle.net/6vmkreyv/7/
<style>
table.footer {
width:100%;
}
td.footer-expandable {
width:100%;
border: 1px solid green;
white-space: nowrap;
text-overflow: clip;
}
td.footer-fixed {
white-space: nowrap;
border: 1px solid blue;
}
</style>
....
<table class="footer">
<tr>
<td class="footer-expandable">
Expandable section.<br/>
It should expand/collapse as necessary to fill all available space.
</td>
<td class="footer-fixed">
Fixed width section.<br/>
It should expand just enough to fit it's contents.
</td>
</tr>
問題的第二部分是如何剪輯文本中的「擴張」部分,因此它不會自動換行?
沒有JS中提供的示例中使用。 – 2014-12-03 02:48:12
我在問如何使用div而不是表格來做同樣的事情。如果佈局改變某處,這將提供更大的靈活性。 – Mike 2014-12-03 12:33:52
我編輯了我的問題,使其更加清晰。 – Mike 2014-12-03 12:39:38