I have problem with vertical-align to text-top on tables
I have globally set at table td
to vertical-align: middle
.
Now I need to change only one td
to vertical-align: text-top
The problem is, that all variant that I tested set vertical-align:text-top
are shown as top only
("xxxx" in image is not at same line as "yyyy")
Only one variant is working as text-top
, and that is change globally style of all td
(I don't want this, I need to change only one td
)
SEE IMAGES
Setting as local style is shown as top local style http://aukro.svecpetr.com/style.png
Setting as class is shown as top local style http://aukro.svecpetr.com/class.png
Changing global td
has the right effect of text-top local style http://aukro.svecpetr.com/global-style.png
EXAMPLE you could find at https://zbozimat.cz/test.php
Could somebody help me?
To place an item at the top or bottom of its cell, insert the "VALIGN=" attribute within the code for that cell. To vertically align an entire row (e.g., placing all data in that row at the tops of the cells), insert the "VALIGN=" attribute within the code for that row.
The CSS just sizes the div, vertically center aligns the span by setting the div's line-height equal to its height, and makes the span an inline-block with vertical-align: middle. Then it sets the line-height back to normal for the span, so its contents will flow naturally inside the block.
Add this for div:
display: inline-block; vertical-align: top;
And this for input:
display: inline-block; vertical-align: top;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With