Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS vertical alignment in table columns

Tags:

html

css

I'm trying to vertically align text in two table columns, one of which also has a text input control. Basic code such as:

<td>Caption</td><td>Enter here <input type="text"></td>

No matter how I apply vertical-align to one or both columns, 'Caption' is not on the same level as 'Enter here'. Most times 'Caption' is higher. What's the solution?

like image 787
user1342299 Avatar asked Aug 03 '26 12:08

user1342299


1 Answers

Try:

td, input {
  vertical-align: middle;
}

If that doesn't work, you will need to post more code to get a good answer.

like image 186
willoller Avatar answered Aug 06 '26 04:08

willoller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!