Bootstrap 4 Tafels


Bootstrap 4 basistabel

Een basic Bootstrap 4 tafel heeft een lichte bekleding en horizontale verdelers.

De .tableklasse voegt een basisstijl toe aan een tabel:

Voorbeeld

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

Gestreepte rijen

De .table-stripedklas voegt zebrastrepen toe aan een tabel:

Voorbeeld

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

Begrensde tafel

De .table-borderedklasse voegt randen toe aan alle kanten van de tabel en cellen:

Voorbeeld

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


Beweeg rijen

De .table-hoverklasse voegt een zweefeffect (grijze achtergrondkleur) toe aan tabelrijen:

Voorbeeld

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

Zwart/donkere tafel

De .table-darkklasse voegt een zwarte achtergrond toe aan de tabel:

Voorbeeld

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

Donker gestreepte tafel

Combineer .table-darken .table-stripedcreëer een donkere, gestreepte tafel:

Voorbeeld

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

Zweefbare donkere tafel

De .table-hoverklasse voegt een zweefeffect (grijze achtergrondkleur) toe aan tabelrijen:

Voorbeeld

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

Randloze tafel

De .table-borderlessklasse verwijdert randen van de tabel:

Voorbeeld

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

Contextuele lessen

Contextuele klassen kunnen worden gebruikt om de hele tabel ( <table>), de tabelrijen ( <tr>) of tabelcellen ( <td>) te kleuren.

Voorbeeld

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]

De contextuele klassen die kunnen worden gebruikt zijn:

Klas Beschrijving
.table-primary Blauw: geeft een belangrijke actie aan
.table-success Groen: Geeft een succesvolle of positieve actie aan
.table-danger Rood: geeft een gevaarlijke of mogelijk negatieve actie aan
.table-info Lichtblauw: Geeft een neutrale informatieve verandering of actie aan
.table-warning Oranje: geeft een waarschuwing aan die mogelijk aandacht behoeft
.table-active Grijs: Past de zweefkleur toe op de tabelrij of tabelcel
.table-secondary Grijs: geeft een iets minder belangrijke actie aan
.table-light Lichtgrijze tafel of tafelrij achtergrond
.table-dark Donkergrijze tafel of tafelrij achtergrond

Kleuren tafelhoofd

De .thead-darkklasse voegt een zwarte achtergrond toe aan tabelkoppen en de .thead-lightklasse voegt een grijze achtergrond toe aan tabelkoppen:

Voorbeeld

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]

Kleine tafel

De .table-smklasse maakt de tabel kleiner door de celopvulling in tweeën te snijden:

Voorbeeld

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

Responsieve tabellen

De .table-responsiveklasse voegt indien nodig een schuifbalk toe aan de tabel (wanneer deze horizontaal te groot is):

Voorbeeld

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

U kunt ook beslissen wanneer de tabel een schuifbalk moet krijgen, afhankelijk van de schermbreedte:

Klas Schermbreedte
.table-responsive-sm < 576px
.table-responsive-md < 768px
.table-responsive-lg <992px
.table-responsive-xl < 1200px

Voorbeeld

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