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>
あなたは自動サイズ設定をどういう意味ですか?ヘッダーのサイズを指定しますか?その%のですか? – Aschab
私は本文の内容と思われるヘッダーテキストの自動サイズを意味します。 – Glen
グリフィスを外しても動くと – Glen