Bootstrap 4 Stoły


Bootstrap 4 Podstawowy stół

Podstawowy stół Bootstrap 4 ma lekką wyściółkę i poziome przegrody.

Klasa .tabledodaje podstawową stylizację do tabeli:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Pasiaste rzędy

Klasa .table-stripeddodaje do tabeli paski zebry:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Stół z obramowaniem

Klasa .table-bordereddodaje obramowania ze wszystkich stron tabeli i komórek:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]


Wskaż wiersze

Klasa .table-hoverdodaje efekt najechania (szare tło) w wierszach tabeli:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Czarny/Ciemny Stół

Klasa .table-darkdodaje do stołu czarne tło:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Stół w ciemne paski

Połącz .table-darki .table-stripedstwórz ciemny stół w paski:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Unoszący się ciemny stół

Klasa .table-hoverdodaje efekt najechania (szare tło) w wierszach tabeli:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Stół bez obramowania

Klasa .table-borderlessusuwa obramowania z tabeli:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Klasy kontekstowe

Za pomocą klas kontekstowych można pokolorować całą tabelę ( <table>), wiersze tabeli ( <tr>) lub komórki tabeli ( <td>).

Przykład

Firstname Lastname Email
Default Defaultson [email protected]
Primary Joe [email protected]
Success Doe [email protected]
Danger Moe [email protected]
Info Dooley [email protected]
Warning Refs [email protected]
Active Activeson [email protected]
Secondary Secondson [email protected]
Light Angie [email protected]
Dark Bo [email protected]

Klasy kontekstowe, których można użyć to:

Klasa Opis
.table-primary Niebieski: oznacza ważną czynność
.table-success Zielony: oznacza udane lub pozytywne działanie
.table-danger Czerwony: oznacza niebezpieczne lub potencjalnie negatywne działanie
.table-info Jasnoniebieski: wskazuje neutralną zmianę informacyjną lub działanie
.table-warning Pomarańczowy: oznacza ostrzeżenie, które może wymagać uwagi
.table-active Szary: stosuje kolor najechania kursorem na wiersz tabeli lub komórkę tabeli
.table-secondary Szary: oznacza nieco mniej ważną czynność
.table-light Jasnoszary stół lub tło rzędu stołu
.table-dark Ciemnoszary stół lub tło rzędu stołu

Kolory główek stołu

Klasa .thead-darkdodaje czarne tło do nagłówków tabel, a .thead-lightklasa dodaje szare tło do nagłówków tabel:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]
Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Mały stół

Klasa .table-smzmniejsza stół, przecinając wypełnienie komórek na pół:

Przykład

Firstname Lastname Email
John Doe [email protected]
Mary Moe [email protected]
July Dooley [email protected]

Responsywne tabele

Klasa .table-responsivedodaje pasek przewijania do tabeli w razie potrzeby (gdy jest za duży w poziomie):

Przykład

<div class="table-responsive">
  <table class="table">
    ...
  </table>
</div>

Możesz także zdecydować, kiedy w tabeli powinien pojawić się pasek przewijania, w zależności od szerokości ekranu:

Klasa Szerokość ekranu
.table-responsive-sm < 576 pikseli
.table-responsive-md <768px
.table-responsive-lg <992px
.table-responsive-xl < 1200 pikseli

Przykład

<div class="table-responsive-sm">
  <table class="table">
    ...
  </table>
</div>