设置el-table-column的字体大小
时间: 2023-11-22 10:48:05 浏览: 85
可以通过设置`el-table-column`的`label`属性来设置字体大小,例如将字体大小设置为14px:
```html
<el-table-column label="序号" min-width="50px" align="center" prop="index" :label-style="{fontSize: '14px'}">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
```
另外,也可以通过设置`el-table`的`style`属性来设置表格中所有单元格的字体大小,例如将字体大小设置为10px:
```html
<el-table :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" style="font-size: 10px">
<el-table-column label="序号" min-width="50px" align="center" prop="index">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<!-- 其他列 -->
</el-table>
```
相关问题
el-table-column 字体大小
很抱歉,根据提供的引用内容,无法确定el-table-column的字体大小。引用中只提到了el-table-column的一些属性,但没有提到字体大小。引用中提到了tableStyle的字体大小为14px,但这个属性是用于整个表格的样式设置,而不是el-table-column的字体大小。引用中也没有提到el-table-column的字体大小。如果您需要设置el-table-column的字体大小,可以在el-table-column标签中添加style属性,并设置font-size属性来实现。
--相关问题--:
1. el-table-column还有哪些常用属性?
2. 如何在el-table中设置表头固定和滚动条?
3.
el-table-column修改字体大小
你可以通过设置 `el-table-column` 的 `headerStyle` 属性来修改表头字体的大小,如下所示:
```
<el-table :data="tableData">
<el-table-column prop="name" label="姓名" :header-style="{ 'font-size': '16px' }"></el-table-column>
<el-table-column prop="age" label="年龄"></el-table-column>
</el-table>
```
你可以根据自己的需要修改 `font-size` 的值。