CSS- responsieve tabel
Responsieve tabel
Een responsieve tabel geeft een horizontale schuifbalk weer als het scherm te klein is om de volledige inhoud weer te geven:
Voornaam | Achternaam | Punten | Punten | Punten | Punten | Punten | Punten | Punten | Punten | Punten | Punten | Punten | Punten |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Jill | Smit | 50 | 50 | 50 | 50 | 50 | 50 | 50 | 50 | 50 | 50 | 50 | 50 |
Vooravond | Jackson | 94 | 94 | 94 | 94 | 94 | 94 | 94 | 94 | 94 | 94 | 94 | 94 |
Adam | Johnson | 67 | 67 | 67 | 67 | 67 | 67 | 67 | 67 | 67 | 67 | 67 | 67 |
Voeg een containerelement toe (zoals <div>) met overflow-x:auto
rond het <table>-element om het responsief te maken:
Voorbeeld
<div style="overflow-x:auto;">
<table>
... table content ...
</table>
</div>
Opmerking: in OS X Lion (op Mac) zijn schuifbalken standaard verborgen en worden ze alleen weergegeven wanneer ze worden gebruikt (zelfs als "overflow:scroll" is ingesteld).
Meer voorbeelden
Dit voorbeeld laat zien hoe je een mooie tafel maakt.
Dit voorbeeld laat zien hoe u het tabelbijschrift plaatst.
Eigenschappen CSS-tabel
Property | Description |
---|---|
border | Sets all the border properties in one declaration |
border-collapse | Specifies whether or not table borders should be collapsed |
border-spacing | Specifies the distance between the borders of adjacent cells |
caption-side | Specifies the placement of a table caption |
empty-cells | Specifies whether or not to display borders and background on empty cells in a table |
table-layout | Sets the layout algorithm to be used for a table |