html5 - ElementUI table中el-table-column怎么设置百分比显示。
问题描述
引入elementui table 模板,<p class='content'>
<el-table :data='tableData' stripe border> <el-table-column prop='title' label='申诉' class='con-tableTitle'> <el-table-column prop='date' label='日期' width='15%'></el-table-column> <el-table-column prop='name' label='姓名' width='5%'></el-table-column> <el-table-column prop='id' label='身份证' width='15%'></el-table-column> <el-table-column prop='hospital' label='医院' width='15%'></el-table-column> <el-table-column prop='cash' label='金额' width='8%'></el-table-column> <el-table-column prop='state' label='审核状态' width='7%'></el-table-column> <el-table-column prop='suggest' label='审核意见' width='25%'></el-table-column> <el-table-column label='操作' width='10%'> <template scope='scope'> <el-button size='small' type='primary' @click='unappeal(scope.$index, scope.row)'>提交</el-button> </template> </el-table-column> </el-table-column> </el-table> </p> 代码部分el-table-column 宽度用百分比写的 ,然后不能按照百分比撑开,同时style会受到scoped限制,文档里面写的是具体值,想问下怎么样能够自定义百分比宽度?
问题解答
回答1:可以尝试class-name属性,自定义一个类名,再写css添加样式
回答2:看文档找到一种方法,是把 width 换成 min-width ,就支持百分比显示啦 !
相关文章:
1. python - 一个程序中的切片问题2. python - TypeError: tryMsgcode() takes exactly 2 arguments (0 given)3. python - 为什么用time.strftime格式化会用默认值?4. module - python模块from import语句相对导入,加不加点号有什么区别?5. nlp - python如何对一篇文章自动分段?6. [python2]local variable referenced before assignment问题7. 请问python中为什么我用for循环对嵌套列表进行赋值时,都是以i的最终值来计算的?8. java - 微信小程序中 无缘无故的提示(图片的加载失败)9. javascript - 像这种内联Js绑定方式,如何定位到js代码?10. javascript - .vue页面跳转问题

网公网安备