el-table嵌套el-select

网上看到的大部分都是嵌套之后一列全是选择器,怎样才能实现只有一个单元格呢
如图这种,如何才能写出来,或者是不是不用element

img

表格的td是有padding、margin的 你如果用组件就调一下padding-margin这些,然后把select框的边框去掉调整背景就好了,但是你要找到对应位置的select f12审查元素 排查一下吧

<el-table-column prop="" align="center">
            <template slot-scope="scope">
              <div>
                {{ scope.$index }}
              </div>
            </template>
 </el-table-column>

scope.$index是当前的行数,可以根据这个值配合v-if或者v-show来对内容实现显示或者隐藏