0

サーバーにアップロードされたファイルを出力するclass=listのテーブルがあり、phpを使用して動的に作成されます。テーブルは別のdiv内にあります。コードは

<div class="list">
<table>....php code for table...</table>
</div>

divリストを固定位置に配置しました.cssファイルは

.list{background:#66CDAA;width:20cm;position:fixed;top:3cm;left:11cm;}

問題は、テーブルが大きくなりすぎるとページがスクロールダウンしないことです。私が試してみました:

body{overflow:auto}

しかし、うまくいきません。別の解決策として、.listに追加できることを知っています

.list{overflow:auto;height:something;}

しかし、リストの高さが固定されたくないので、ページの代わりにテーブルがスクロールします。では、代替手段はありますか??

4

1 に答える 1

0

これを試して:

<div class="listcontainer"><div class="list"><table>...</table></div></div>

CSS:

.listcontainer {
    position: fixed;
    width: 20em;
    top: 3cm;
    left: 11cm;
    bottom: 3cm;
    right: 11cm;
    overflow: auto;
} /* adjust right and bottom to be what the maximum size should be */
.list {
    background-color: #66cdaa;
    max-height: 100%;
}
于 2012-07-08T18:41:18.400 に答える