私があなたを理解しているなら、あなたは表形式のデータを持っていますが、div
要素を使用してブラウザにそれを提示したいと思います(display:tableを持つAFAIKテーブルとdivはほとんど同じように動作します)。
(ここに動作するjsfiddleがあります:http://jsfiddle.net/roimergarcia/CWKRA/)
マークアップ:
<div class='theTable'>
<div class='theRow'>
<div class='theCell' >first</div>
<div class='theCell' >test</div>
<div class='theCell bigCell'>this is long</div>
</div>
<div class='theRow'>
<div class='theCell'>2nd</div>
<div class='theCell'>more test</div>
<div class='theCell'>it is still long</div>
</div>
</div>
そしてCSS:
.theTable{
display:table;
width:95%; /* or whatever width for your table*/
}
.theRow{display:table-row}
.theCell{
display:table-cell;
padding: 0px 2px; /* just some padding, if needed*/
white-space: pre; /* this will avoid line breaks*/
}
.bigCell{
width:100%; /* this will shrink other cells */
}
悲しい部分は、私が本当にそれを必要としていた1年前にこれを行うことができなかったことです-_-!