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. thinkPHP5中獲取數據庫數據后默認選中下拉框的值,傳遞到后臺消失不見。有圖有代碼,希望有人幫忙3. linux運維 - python遠程控制windows如何實現4. Python2中code.co_kwonlyargcount的等效寫法5. javascript - 如何用最快的速度C#或Python開發一個桌面應用程序來訪問我的網站?6. django - Python error: [Errno 99] Cannot assign requested address7. mysql數據庫做關聯一般用id還是用戶名8. [python2]local variable referenced before assignment問題9. 求救一下,用新版的phpstudy,數據庫過段時間會消失是什么情況?10. python小白,關于函數問題
