要让这个table中的内容居中,可以在table标签中添加style='margin: 0 auto;'属性。修改后的代码如下:

<table border='1' style='margin-top: 15px;width: 100%; margin: 0 auto;'>
    <tr style='height: 80px'>
        <th style='width: 10%;text-align: center;font-weight: 350'>所在部门</th>
        <th colspan='3'>
            <span  v-for='(item, index) in arr' :key='index' style='font-weight: 350'>
                <a-col :span='24'>
                    <input type='checkbox' checked disabled>{{item.handoverCategory}}——
                    <span style='font-weight: 350'>{{item.handoverContent}}</span>——
                    <span v-for='(file, fileIndex) in item.file' :key='fileIndex'>
                        <a :href=''/api/api-system/system/core/sysFile/previewFile?fileId=' + file.fileId'>{{file.name}}</a>
                        <span v-if='fileIndex !== item.file.length - 1'>;</span>
                    </span>
                </a-col>
            </span>
        </th>
    </tr>
</table>
如何在表格中居中内容?

原文地址: https://www.cveoy.top/t/topic/c16S 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录