Horizontal and vertical alignment div

I am using jQuery. I have a div containing a table. I have 4 rows in a table, each with one column. Each line contains a line or two texts

I want to make each line with height = 100 px and have text horizontally and vertically.

Can this be done?

+3
source share
2 answers

If you want the text in each cell of the table to be aligned vertically and horizontally, you can use CSS.

table td {
    height: 100px;
    text-align: center;
    vertical-align: middle;
}

See how it works.

+4
source

very simple:

text-align: center;
vertical-align: middle:
0
source

Source: https://habr.com/ru/post/1770109/


All Articles