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. javascript - vscode alt+shift+f 格式化js代碼,通不過eslint的代碼風(fēng)格檢查怎么辦。。。2. javascript - 如何將一個div始終固定在某個位置;無論屏幕和分辨率怎么變化;div位置始終不變3. html5 - 有可以一次性把所有 css外部樣式轉(zhuǎn)為html標簽內(nèi)style=" "的方法嗎?4. javascript - 有什么比較好的網(wǎng)頁版shell前端組件?5. java - 如何寫一個intellij-idea插件,實現(xiàn)編譯時修改源代碼的目的6. javascript - 原生canvas中如何獲取到觸摸事件的canvas內(nèi)坐標?7. java 中Long 類型如何轉(zhuǎn)換成Double?8. javascript - 求解答:實例對象調(diào)用constructor,此時constructor內(nèi)的this的指向?9. html - vue項目中用到了elementUI問題10. javascript - [js]為什么畫布里不出現(xiàn)圖片呢?在線等
