
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 表头文字如何对齐?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号