Jadvaldagi barcha tds harflarining hajmini qanday oshirish mumkin?

Menda ba'zi satrlarda jadval bor. TD shrift hajmini 24 soatgacha oshirishni xohlayman. Barcha td ma'lumotlarining shrift o'lchamlari ortishi uchun bosh uslubida CSS uslubi qanday yoziladi?

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

<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>
</div> </div>
0
Faqat th shrift o'lchamini ni oshirishni xohlaysizmi?
qo'shib qo'ydi muallif Abhishek Pandey, manba

6 javoblar

Siz bunga o'xshash narsani uyg'unlashtirishingiz mumkin:

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

Yoki sodda va adolatli bajarishingiz mumkin:

td {
  font-size: 24px;
}

Bu CSS-ning kontekstiga bog'liq bo'lib, sizga qanchalik aniq bo'lishi kerak. Imkoniyatlar ikkinchi variantni amalga oshiradi.

4
qo'shib qo'ydi
px kabi shrift o'lchamiga ustida sizning qurilmangiz kerak deb o'ylayman ...
qo'shib qo'ydi muallif tiffon, manba
men uchun ishlaydi
qo'shib qo'ydi muallif Swapna, manba

table ni tanlang va style barcha td elementlari uchun oddiy tarzda bering.

table td{
    font-size:24px;
}
2
qo'shib qo'ydi

Ushbu kodni tekshiring

.table td {
  font-size: 30px;
}

Jonli

1
qo'shib qo'ydi

U to'g'ridan-to'g'ri ur html faylida buni amalga oshirishi mumkin:

<table class="table table-striped">
  ...
</table>

Yoki style.css yangi CSS faylini yaratishingiz mumkin:

<link rel="stylesheet" type="text/css" href="style.css">

<table class="table table-striped">
  ...
</table>

va style.css da bo'ladi:

table td {
  font-size: 24px;
}
1
qo'shib qo'ydi

Faqat shunga o'xshash narsa.

td {
    font-size: 24px;
}
0
qo'shib qo'ydi

Siz ham foydalanishingiz mumkin

<table class="mytable">
<tbody>
  <tr>
    <td>ABC</td>
    <td>DEF</td>
  </tr>
</tbody>
</table>
0
qo'shib qo'ydi