我有一个表,其中有一些列,现在我想设置列名的大小。默认情况下它现在很小。
这是我的专栏名称---
<tr class="something">
<th> Name </th>
<th>Phone</th>
</tr>
脚本不起作用----
<script>
$(".something") th {
font - size: 2em; /* em is relative to the parent font size */
font - weight: bold;
}
</script>
现在使用 bootstrap 或基本 html 如何设置列名称粗体和大。
我知道有成千上万的解决方案可以解决这个问题,尽管我想知道它是如何解决的。
任何人都知道如何解决这个问题。提前致谢。
最佳答案
使用 font-size
和 font-weight
来设置列名的粗体大小。
// Alternate jQuery Solution since you use Twitter Bootstrap
var header = $('.something th');
header.css('font-size', '2em');
header.css('font-weight', 'bold');
/* Simple CSS Solution */
.something th {
font-size: 2em; /* em is relative to the parent font size */
font-weight: bold;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr class="something">
<th>Name</th>
<th>Phone</th>
</tr>
</table>
关于html - 设置表列名称的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31937831/