三国战纪2vivo版
1.9GB · 2025-12-06
element UI里面表格的行高需要自己调整高度和设置padding,直接写style是不行的,里面有 :
1、row-style (行的 style)
2、header-row-styl (表头行的 style)
3、cell-style(单元格的 style)
<el-table border :span="24" :row-style="{height:'32px'}" :header-row-style="{height:'32px'}" :cell-style="{padding:'1px'}"> <el-table-column></el-table-column> <el-table-column></el-table-column></el-table>也可以高度定制表格的样式,比如
<template><el-table :cell-style="getTdStyle" :data="tableData" ref="tableData" border style="width: 100%;" max-height="555">....</el-table></template><script>export default { methods: { getTdStyle(row) { // console.log("row", row); let style = {}; // 单独设置表格第三行的样式 if (row.rowIndex == 2) { style = { backgroundColor: "#f5f7fa", color: "#606266", }; } return style; } }}</script>