el-table 设置表头居中 ,表格内容某一列单独居中或左对齐或者右对齐

方法:

表头可以用::header-cell-style="{'background-color': '#F1F4FF' ,'text-align':'center'}"

具体列可以分别设置    align="left" align="center"  align="right"


若需要调整表格内数据格式可以做如下处理:

<el-table-column prop="REGISTERLIMIT" label="注册总额度" width="120" align="right" class-name="col-content">

                <template #default="scope">

                        <div style="margin-right:20px;"> {{ moneyFormatter((scope.row.REGISTERLIMIT / 100000000).toFixed(2)) }} 亿元 </div>

                </template>

 </el-table-column>

<el-table-column prop="unusedAmount" width="100" label="未使用额度" align="right" class-name="col-content" >

                <template v-slot="scope">

                        <div style="margin-right:9px;">{{moneyFormatter(((scope.row.REGISTERLIMIT - scope.row.ISSBDRECECASH) /                                                                                     100000000).toFixed(2))  + '亿元'}}</div>

                </template>

 </el-table-column>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容