Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

How to verticallly align to center inside table cells?

UPDATE: RESOLVED: style="vertical-align:middle" does the job

So basically to allign to center horizonattally you do <center>something</center>

But how can you make so it's alligned to center vertically as well? (Example, if some cells are bigger, then others look weird and it would be better if it could be alligned to center by vertical as well...)
<center> </center> is not cross browser supported and is not HTML5, which means is not updated. There are better solutions for centring elements.
You can do it using CSS:

Code
.center {
   box-sizing: border-box;
   margin-left: auto;
   margin-right: auto;
   position: relative;
}
I understand you're working with a table. If you want to achieve both vertical and horizontally centering an element without that, you can use display: flex;. Elements with display: flex; can use things like 'justify-content: center;' and 'align-items: center;' or 'align-content: center;'. Note that display:flex; isn't supported by all browsers tho.

A complete guide on the topic can be found here: https://css-tricks.com/centering-css-complete-guide/
[Image: AAjOYL.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by bevcMay 14, 2020 12:26 PM 3 128 May 14, 2020 12:26 PM
Last Post: I337
by KjetilMar 5, 2018 02:59 PM 1 132 Mar 5, 2018 02:59 PM
Last Post: Rushax
by .THCSep 24, 2015 06:16 PM 0 137 Sep 24, 2015 06:16 PM
Last Post: .THC