废话不多说,直接给每个el-table-column,设置
width="auto" min-width="25%"
即可。
总的百分比还是要等于100%哈。
点赞收藏吧 感谢
代码可以直接复制使用:
<template><div style="width:1300px;"><el-table border :data="tableData" fit style="width: 100%"><el-table-column label="文字" width="auto" min-width="25%"><template slot-scope="scope"><el-input v-model="scope.row.obj1.string"></el-input></template></el-table-column><el-table-column prop="name" label="姓名" width="auto" min-width="25%"></el-table-column><el-table-column prop="a" label="a" width="auto" min-width="5%"></el-table-column><el-table-column prop="b" label="b" width="auto" min-width="5%"></el-table-column><el-table-column prop="c" label="c" width="auto" min-width="5%"></el-table-column><el-table-column prop="d" label="d" width="auto" min-width="5%"></el-table-column><el-table-column prop="e" label="e" width="auto" min-width="5%"></el-table-column><el-table-column prop="f" label="f" width="auto" min-width="5%"></el-table-column><el-table-column prop="address" label="地址" width="auto" min-width="20%"></el-table-column></el-table></div>
</template><script>export default {data () {return {tableData: [{obj1: { string: '比例25%' }, name: '比例25%', a: '比例5%', b: '比例5%', c: '比例5%', d: '比例5%', e: '比例5%', f: '比例5%', address: '比例20%'},{obj1: { string: '一二三四五六七八九十' }, name: '王小虎', a: '12', b: '211', c: '111', d: '1', e: 11, f: '122', address: '上海市普陀区金沙江路 1517 弄'},{obj1: { string: '条件他又长又短的的女分的看到偶尔偶尔饿哦偶尔分佛开口分配佛分富婆看哦考配哦' }, name: '王小虎', a: '111111', b: '211', c: '111', d: '1', e: 11, f: '122', address: '上海市普陀区金沙江路 1519 弄'},{obj1: { string: '条件他又长又看到配佛分富婆看哦考配哦' }, name: '王小虎', a: '12', b: '211', c: '111', d: '1', e: 11, f: '122', address: '123456789'}]}}
}
</script>