在下面的网格中,如何添加滚动条。 它只是使用bootstrap col 12 div下的bootstrap table。
我尝试了以下CSS,但它不适用于滚动条,只会弄乱列。
divgrid.horizontal {
width: 100%;
height: 400px;
overflow: auto;
}
.table {
display: table;
table-layout: fixed;
width: 100%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-md-12" id="divgrid">
<table class="table table-striped table-bordered">
<thead class="ui-widget-header">
<tr>
<th v-for="header in columns()">
{{header.displayName }}
</th>
</tr>
</thead>
<tbody>
<tr v-for="(row,index) in datasourc">
<td v-for="column in columns" class="wrap-break-word" v-show="column.isVisible">
<span v-html="row[column.name]"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>