css - ionic中的柵格布局如何讓文字內(nèi)容多少不同的每一列中的內(nèi)容都能垂直居中?
問題描述
每一列數(shù)據(jù)是由angular遍歷生成效果如下圖:
因為左側(cè)名稱文字多少不同,所以右側(cè)數(shù)據(jù)會出現(xiàn)偏上顯示情況,已經(jīng)試了display: table-cell; vertical-align: middle;,但是沒效果,也試了用line-height設(shè)置,但也不行,求大神指點,多謝啊!代碼結(jié)構(gòu)是這樣的: <ion-row *ngFor='let row of config.rows'>
<ion-col col-3>{{row.rowName}}</ion-col> <!-- 左側(cè)名稱 --> <ion-col *ngFor='let col of row.cols'>{{col.data.value}}</ion-col> <!-- 右側(cè)數(shù)據(jù) -->
</ion-row>右側(cè)三列數(shù)據(jù)是統(tǒng)一遍歷生成的
使用ionic的align-self-center,發(fā)現(xiàn)表格的框線會出問題,求解啊啊啊啊啊
<ion-row *ngFor='let row of config.rows'>
<ion-col col-3> {{row.rowName}}</ion-col> <ion-col align-self-center> <ion-row><ion-col *ngFor='let col of row.cols'>{{col.data.value}}</ion-col> </ion-row> </ion-col>
</ion-row>
問題解答
回答1:display:flex; align-items:center
相關(guān)文章:
1. 為什么我ping不通我的docker容器呢???2. 關(guān)于docker下的nginx壓力測試3. javascript - vue vue-router 報$router重復(fù)定義4. java - 根據(jù)月份查詢多個表里的內(nèi)容怎么實現(xiàn)好?5. javascript - webpack熱加載配置不生效6. 關(guān)于Java引用傳遞的一個困惑?7. debian - docker依賴的aufs-tools源碼哪里可以找到啊?8. windows2003下的apache響應(yīng)時間特別長?9. angular.js - angular內(nèi)容過長展開收起效果10. node.js - node exec 執(zhí)行沒反應(yīng)
