gpt4 book ai didi

html - css Autosize表头与glyphicon

转载 作者:行者123 更新时间:2023-11-28 05:06:11 28 4
gpt4 key购买 nike

是否可以根据包含右对齐字形的标题大小自动调整列大小?

例如:

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

风格:

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

将字形推到第二列。

完整代码:

<!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>

最佳答案

哎呀总是你花几个小时改变 css 看看什么有效的方式,通过在这里发布我打开了灯,我所要做的就是从 glyphicon 中删除 pull-right 类

关于html - css Autosize表头与glyphicon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39814966/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com