Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase font size of all tds in the table

Tags:

html

css

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>
like image 481
Swapna Avatar asked Oct 15 '25 14:10

Swapna


1 Answers

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;
}

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

like image 95
Cassidy Avatar answered Oct 18 '25 07:10

Cassidy