2016-10-02 10 views
0

グリフコンを右揃えにしたヘッダーサイズで列を自動サイズ設定することはできますか?cssグリフコンで表のサイズを自動調整する

例えば:

 <th class='autosize'>Col1 <span class='glyphicon glyphicon-sort pull-right' aria-hidden='true'></span></th> 

とスタイル:

<style> 
    .autosize { 
    width: 1px; 
    white-space: nowrap; 
    } 
</style> 

が二列にglyphiconをプッシュします。

全コード:常に

<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 

    <style> 
    .autosize { 
     width: 1px; 
     white-space: nowrap; 
    } 
    </style> 
</head> 
<body> 
    <table class="table table-bordered" style="width: 1px;"> 
    <thead> 
     <tr> 
     <th class='autosize'>Col1 <span class='glyphicon glyphicon-sort pull-right' aria-hidden='true'></span></th> 
     </tr> 
    </thead> 
    </table> 
</body> 
</html> 
+1

あなたは自動サイズ設定をどういう意味ですか?ヘッダーのサイズを指定しますか?その%のですか? – Aschab

+0

私は本文の内容と思われるヘッダーテキストの自動サイズを意味します。 – Glen

+0

グリフィスを外しても動くと – Glen

答えて

0

ジー私はライトがオンになっていたもので動作し、ここに掲載することにより、確認するために、CSSを変更する時間を過ごすようにして、私がしなければならなかったすべては、プルライトクラスを削除していますグリフコンの外に

関連する問題