elementui实现el-table-column表格平均分配

369 阅读1分钟

1.把el-table-column把width属性去掉就自动平均分配

<el-table :data="tableData" border style="width: 100%; margin: 10px">
      <el-table-column prop="num" label="序号"  />
      <el-table-column prop="id" label="名字"  />
      <el-table-column prop="describe" label="描述"  />
      <el-table-column prop="time" label="更新时间"  />
      <el-table-column prop="status" label="状态" >
        <template #default="scope">
          <span v-show="scope.row.status == 1">
            <el-button type="success" round size="small" style="margin-right: 5px"></el-button>启用
          </span>
          <span v-show="scope.row.status == 0">
            <el-button type="danger" round size="small" style="margin-right: 5px"></el-button>禁用
          </span>
        </template>
      </el-table-column>
</el-table>

2.el-table-column使用min-width可以设置百分比,如min-width:'10%'

原文链接:blog.csdn.net/qq_46108386…