Element Table 表头文字如何对齐?
哈喽!大家好,很高兴又见面了,我是米云的一名作者,今天由我给大家带来一篇《Element Table 表头文字如何对齐?》,本文主要会讲到等等知识点,希望大家一起学习进步,也欢迎大家关注、点赞、收藏、转发! 下面就一起来看看吧!

element table 表头文字对齐
想要在 element table 中对齐不同长度的表头文字,可以尝试使用自定义插槽:
<el-table-column
width="45"
:label="citem.name"
v-show="item.children.length"
v-for="(citem, cindex) in item.children"
:key="cindex"
align="center"
>
<template slot-scope="scope">
{{ scope.row.dataList[citem.index].count }}
</template>
<template slot="header">
<div v-html="citem.name"></div>
</template>
</el-table-column>
在 slot-header 中,使用 v-html 可以直接渲染 html 内容,从而控制表头文字的格式。通过这种方式,可以将两个字与四个字对齐。
以上就是《Element Table 表头文字如何对齐?》的详细内容,更多关于的资料请关注米云公众号!
- 如何高效地查找用户是否参与了包含其 ID 的项目?
