How does the div in td center vertically?

clipboard.png

clipboard.png


clipboard.png

Css
Mar.15,2021

td .ant-row,td .cell {
    display: flex;
    align-items: center;
}

you have already used < table > Why put

in it? just do the table to the end.


ask the subject of the question, is it the div where the text is located? If the text is centered, first set a height to the div where the text is located, and then use either line-height or padding-top.


add vertical-align:middle to both div and picture;


set img, vertical-align:middle; the div where the text is located first set vertical-align:middle
, then set line-height to the div where the text is located


td set vertical-align:middle


.cell{
    display: table-cell;
}
.cell>div{
    display: inline-block;
    vertical-align: middle;
}
Menu