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>

 

本站提供的所有下载资源均来自互联网,仅提供学习交流使用,版权归原作者所有。如需商业使用,请联系原作者获得授权。 如您发现有涉嫌侵权的内容,请联系我们 邮箱:[email protected]