更改元素 UI 表格行的高度

Sim*_*iel 1 vue.js vuejs2 element-ui

我想减小 Element UI 表格行的间距以适应屏幕上的更多行。

不幸的是,我在 Element UI 文档中看不到任何选项:https : //element.eleme.io/#/en-US/component/table

直接为类设置定义的高度el-table__row不会导致任何高度变化。

fab*_*uex 6

You can use one of the following methods:

1) set the size attribute with "small" or "mini"

<el-table :data="tableData" size="small">
Run Code Online (Sandbox Code Playgroud)

2) use the cell-style attribute to remove padding from cells and set a fixed height

<el-table :data="tableData" :cell-style="{padding: '0', height: '20px'}">
Run Code Online (Sandbox Code Playgroud)

Here's the complete list of the available options: https://element.eleme.io/#/en-US/component/table#table-attributes