html - 设置表列名称的大小

标签 html twitter-bootstrap twig

我有一个表,其中有一些列,现在我想设置列名的大小。默认情况下它现在很小。

这是我的专栏名称---

<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-sizefont-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/

相关文章:

twitter-bootstrap - 为什么要使用 Bootstrap .w-100 类将一行的列拆分为两行,而您只能制作两行?

css - 使用 less 和 Bootstrap 的媒体查询

php - WordPress Timber 获取自定义帖子类型的帖子

javascript - 在 symfony 4 twig 模板中分离 JavaScript 文件

java - 从浏览器启动应用程序

javascript - 解耦按钮(2个按钮同时切换)并根据数据显示适当的按钮

html - 响应式 HTML 电子邮件 - Outlook 的 3 列布局间距

php - PDF 生成不保留样式表

html - ffox/chrome 中的 Colgroup

symfony - 覆盖 Twig 模板中的小部件时直接访问表单字段的值