Skip to content

CSS: table ​

.instui-table — Stílusozott adattábla th és td elemekhez, opcionális felirattal; támogatja a hover, fixed és stacked-card elrendezéseket.

A -layout-stacked esetén a tiszta CSS nem tudja minden oszlopfejléc szövegét a cellába helyezni, ezért adj minden cellának data-label-t; a stacked card azt ::before segítségével jeleníti meg. Lásd a table.head, table.body, table.row, table.cell, table.col-header és table.row-header tagokat az egyes részekhez.

Source: body.css

Hozzáférhetőség ​

Címkézd a táblát egy <caption>-val, jelöld az oszlopfejléceket <th scope="col">-vel és a sorfejléceket <th scope="row">-vel; a -layout-stacked elrendezésnél minden cellának adj data-label-t, mert a fejlécsor vizuálisan el van rejtve.

Használat ​

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/table.css";

Példák ​

html
<table class="instui-table -hover">
  <caption>Legjobbra értékelt filmek</caption>
  <thead>
    <tr>
      <th scope="col">Helyezés</th>
      <th scope="col">Cím</th>
      <th scope="col">Év</th>
      <th scope="col">Értékelés</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>A remény rabjai</td>
      <td>1994</td>
      <td>9.3</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>A keresztapa</td>
      <td>1972</td>
      <td>9.2</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>A keresztapa: 2. rész</td>
      <td>1974</td>
      <td>9.0</td>
    </tr>
  </tbody>
</table>

Struktúra ​

text
.instui-table.-hover
  caption
  thead
    th
  tbody
    tr
      td, th[scope="row"]
flowchart TD n0[".instui-table.-hover"]:::cssdoc-root n1("caption"):::cssdoc-part n2("thead"):::cssdoc-part n3("th"):::cssdoc-part n4("tbody"):::cssdoc-part n5("tr"):::cssdoc-part n6("td, th[scope=&quot;row&quot;]"):::cssdoc-part n0 --> n1 n2 --> n3 n0 --> n2 n5 --> n6 n4 --> n5 n0 --> n4 classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

Módosítók ​

MódosítóLeírás
.-hoverEmeld ki a sorokat hover esetén. @affects table.row — Fenntartja és színezi a sor hover keretét.
.-layout-fixedFix táblarendezés (egyenlő szélességű oszlopok).
.-layout-stackedRendezze a sorokat kártyákká cellánkénti data-label segítségével. @affects table.head @affects table.body @affects table.row @affects table.cell @affects table.col-header @affects table.row-header — Minden részt blokká alakít és ennek megfelelően elrejti/címkézi a fejlécet.

Részek ​

RészLeírás
.captionOpcionális táblafelirat.

Fogyasztott tokenek ​

TokenTípusÉrték
--instui-component-table-background<color>LightDarklight-dark(#ffffff, #10141A)
--instui-component-table-cell-padding-horizontal<length>0.75rem
--instui-component-table-cell-padding-vertical<length>0.5rem
--instui-component-table-col-header-color<color>LightDarklight-dark(#273540, #F2F4F5)
--instui-component-table-color<color>LightDarklight-dark(#273540, #ffffff)
--instui-component-table-font-family[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-table-font-size<length>1rem
--instui-component-table-head-font-weight<integer>600

Alkomponensek ​