开发者

Centering content vertically (and horizontally) in a div

开发者 https://www.devze.com 2023-03-10 18:47 出处:网络
First the example: http://jsfiddle.net/5S3mk/3/ I have a table whose columns need to be sortable so in the table header there should be links for sorting. The columns themselves are dynamic and their

First the example: http://jsfiddle.net/5S3mk/3/

I have a table whose columns need to be sortable so in the table header there should be links for sorting. The columns themselves are dynamic and their width is not known in advance.

In order to center开发者_JAVA技巧 the header content horizontally I used the recipe from here.

Now I'm having trouble with adjusting the spans inside container div to center vertically. Does anyone have any idea how to do this (legacy browser are not an issue)?


Here you have one way of doing it. It uses a little jQuery script, but it is really simple.

0

精彩评论

暂无评论...
验证码 换一张
取 消