私のアプリケーションでは、データベースレコードのブートスタープグリッドを表示する必要があります。レコード数はフルページスクロールせずに表示するのに十分なので、私はテーブルをスクロール前のスクロール可能なdivでラップし、テーブルをスクロールする機能を私に与えました。しかし、DIVのサイズは常にブラウザウィンドウの半分です。私はほぼすべてのスタックオーバーフローポストや提案を試みただけで、私のために働いていない。私はまた、これをJavaスクリプトのサポートで修正しようとしましたが、失敗しました。ブートストラップの固定高さDIV
これは私がPHPコードの結果をテーブルの上に移入私のHTMLコード
<div class="col-md-9">
<div class="pre-scrollable">
<table class="table table-bordered table-hover header-fixed" id="sometable">
<thead>
<tr>
<th>EMP_No</th>
<th>Name</th>
<th>Designation</th>
<th>Department</th>
<th>Type</th>
<th>#Days</th>
<th>Start Date</th>
<th>End Date</th>
<th>Half day</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</tbody>
<?php //php code for print the table
?>
</div>
</div>
です。
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: center;
padding: 1px;
}
thead th {
text-align: center;
background-color: #3498db;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
ありがとう!!これは単純に問題を解決します。 –