2015-04-23 40 views
0
<th>Cars <i class="fa fa-sort-asc pull-right"></i></th> 

當我使用自舉的pull-right類,它對準的圖標我th到右上角,除去pull-right對齊圖標垂直居中的左側,但有一種方法,使當我使用pull-right時,它在中心垂直向右對齊?引導的右拉式類

我使用引導和圖標從fontawesome

+1

顯示其他代碼,它垂直對齊你的'TH' – Justinas

+0

爲什麼你想絕對使用'沒有它的'拉右'你得到你想要的渲染? – ylerjen

+0

我正在使用引導程序,而我的意思是內部的元素如果被誤解了,當我不使用拉右類時,會自動在中心對齊。但是使用右鍵將它放在右上角 –

回答

2

您可以使用的範圍,而不是pull-left ..

<th class="text-right"> 
    <span class="pull-left">First Name</span> 
    <i class="fa fa-sort-asc"></i> 
</th> 

http://codeply.com/go/DIWtVsyMwh

引導4pull-left現在是float-left

0

你可能對右邊的圖標,並用這樣的文字垂直對齊:

HTML

<th> 
    <div class="header-with-icon"> 
    <div>First Name</div> 
    <div class="text-right"><i class="fa fa-sort-asc"></i></div> 
    </div> 
</th> 

CSS

.header-with-icon{ 
    display: table; 
    width: 100%; 
} 

.header-with-icon > div{ 
    display: table-cell; 
} 

這裏有一個bootply例如:http://www.bootply.com/Df5JpMyU2k