el-table 表头和文字都居中方法
在日常开发中,需要写个表格,并且想要美观一点,如果想要el-table 表头和文字可以居中显示?直接上方法:在el-table标签中加入: header-cell-style=“{ ‘text-align’: ‘center’ }”: cell-style=“{ ‘text-align’: ‘center’ }”<el-table: data="tableData"stripeborderh
·
在日常开发中,需要写个表格,并且想要美观一点,如果想要el-table 表头和文字可以居中显示?
直接上方法:
在el-table标签中加入
: header-cell-style=“{ ‘text-align’: ‘center’ }”
: cell-style=“{ ‘text-align’: ‘center’ }”
<el-table
: data="tableData"
stripe
border
highlight-current-row
: header-cell-style="{ 'text-align': 'center' }"
: cell-style="{ 'text-align': 'center' }"
style="width: 100%; margin-top: 8px; text-align: center"
>
<el-table-column label="序号" type="index" width="80">
</el-table-column>
<el-table-column prop="title" label="标题"> </el-table-column>
<el-table-column prop="num" label="数量" sortable width="100">
</el-table-column>
</el-table>
更多推荐
已为社区贡献2条内容
所有评论(0)