タイトルの通り、テーブルをスクロールして下の方を表示すると表の中がずれてしまいます。
スクロールしても中身が固定されちゃんと表示させるようにしたいです。
よろしくお願いします。
html
1 <table class='table table-striped' id='tbl'> 2 <thead> 3 <tr> 4 <th class="a">id</th> 5 <th class="b">名前</th> 6 <th class="c">処理</th> 7 </tr> 8 </thead> 9 <tbody> 10 @if(isset($results)) 11 @foreach($results as $result) 12 <tr> 13 <td>{{$result->id}}</td> 14 <td>{{$result->name}}</td> 15 <td> 16 {!! Form::open(['route' => ['sample.delete'], 'method' => 'post']) !!} 17 <input type='hidden' name='id' value='{{$result->id}}'> 18 <input type='hidden' name='name' value='{{$result->name}}'> 19 <button type="submit" class="btn btn-danger btn-xs btn-destroy">削除</button> 20 {!! Form::close() !!} 21 </td> 22 </tr> 23 @endforeach 24 @endif 25 </tbody> 26 </table>
css
1#tbl{ 2 margin-left: 520px; 3 width: 553px; 4} 5 6.a,.b,.c{width: 200px;} 7thead, tbody { 8 display: block; 9} 10tbody { 11 overflow-y: scroll; 12 height: 650px; 13 width: 550px; 14} 15td { 16 width: 221px; 17}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/26 23:21
2018/02/27 01:21