如何改变下列代码中表格每行的高度template div class=table el-dialog title=与会情况 visiblesync=dialogTableVisible el-table ref=filterTable data=tableData border header-cell-style= back
要改变表格每行的高度,可以通过修改表格行的样式来实现。在样式部分的.table选择器下添加如下代码:
.el-table__row {
height: 50px; // 设置行高度为50px
}
修改后的代码如下:
<template>
<div class="table">
<el-dialog title="与会情况" :visible.sync="dialogTableVisible">
<el-table
ref="filterTable"
:data="tableData"
border
:header-cell-style="{ background: '#F9F4F4', color: '#333333' }"
>
<!-- 表格列省略 -->
</el-table>
</el-dialog>
</div>
</template>
<script>
export default {
// 省略部分代码
}
</script>
<style lang="scss" scoped>
.table {
width: 90%;
margin: auto;
}
.el-table__row {
height: 50px; // 设置行高度为50px
}
</style>
通过将.el-table__row选择器下的height属性设置为所需的行高度即可改变表格每行的高度
原文地址: http://www.cveoy.top/t/topic/iJjM 著作权归作者所有。请勿转载和采集!