html5 - ElementUI table中el-table-column怎么設(shè)置百分比顯示。
問題描述
引入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='醫(yī)院' width='15%'></el-table-column> <el-table-column prop='cash' label='金額' width='8%'></el-table-column> <el-table-column prop='state' label='審核狀態(tài)' 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 ,就支持百分比顯示啦 !
相關(guān)文章:
1. 數(shù)據(jù)庫 - MySQL 單表500W+數(shù)據(jù),查詢超時,如何優(yōu)化呢?2. python - Django分頁和查詢參數(shù)的問題3. 求大神幫我看看是哪里寫錯了 感謝細(xì)心解答4. MySQL客戶端吃掉了SQL注解?5. 網(wǎng)頁爬蟲 - python爬蟲翻頁問題,請問各位大神我這段代碼怎樣翻頁,還有價格要登陸后才能看到,應(yīng)該怎么解決6. javascript - 圖片能在網(wǎng)站顯示,但控制臺仍舊報錯403 (Forbidden)7. php自學(xué)從哪里開始?8. mysql - AttributeError: ’module’ object has no attribute ’MatchType’9. android - Windows系統(tǒng)下運(yùn)行react-native App時,報下面的錯誤?10. phpstady在win10上運(yùn)行
