如何增加表格中所有tds的字体大小 [英] How to increase font size of all tds in the table

查看:33
本文介绍了如何增加表格中所有tds的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有表格,里面有一些行.我想在整个表中将 td 字体大小增加到 24.如何在head中为td编写css样式,以便增加所有td数据的字体大小.

I have table in that some rows are there. I want to increase the td font size to 24 in etire table. How to write css style for td in the head so that font size of all the td data will be increased .

<table class="table table-striped">
  <thead>
    <tr class="success">
      <th class="success">a</th>
      <th>1</th>
      <th>2</th>
      <th>3</th>
      <th>4</th>
      <th>5</th>
    </tr>
  </thead>
  <tbody>
    <tr class="danger">
      <td id="hhh" class="success">filled</td>
      @foreach (var item in Model) {
      <td>@item.Filled.ToString("N2") cm</td>
      }
    </tr>
    <tr class="info">
      <td>Updated time</td>
      @foreach (var item in Model) {
      <td>@item.UpdatedTime</td>
      }
    </tr>
    <tr class="warning">
      <td>Area</td>
      @foreach (var item in Model) {
      <td>@item.Area</td>
      }
    </tr>
  </tbody>
</table>

推荐答案

您可以像这样嵌套所有内容:

You can nest everything like this:

table tbody tr td {
  font-size: 24px;
}

或者你可以保持简单,然后做:

Or you could keep it simple and just do:

td {
  font-size: 24px;
}

这取决于您的 CSS 的上下文,以及您需要的具体程度.有可能是第二种选择.

This depends on the context of your CSS, how specific you need to be. Chances are the second option will do.

这篇关于如何增加表格中所有tds的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆