SourceIitafile
Amaxwebhu kunye nemizekelo yokukhetha ukungena kwisitayile seetafile (kunikwe usetyenziso oluxhaphakileyo kwiiplagi zeJavaScript) ngeBootstrap.
Imizekelo
Ngenxa yokusetyenziswa ngokubanzi kweetheyibhile kuzo zonke iiwijethi zomntu wesithathu ezifana neekhalenda kunye nabakhethi bemihla, siyile iitafile zethu ukuba zingene . Yongeza nje iklasi yesiseko .table
kuyo nayiphi na <table>
, emva koko wandise ngezitayile zesiko okanye iiklasi zethu ezahlukeneyo ezibandakanyiweyo zokulungisa.
Usebenzisa olona phawu lusisiseko lwetafile, nantsi indlela-esekwe njani .table
iitafile kwiBootstrap. Zonke izimbo zetafile zizuzwe kwi-Bootstrap 4 , okuthetha ukuba naziphi na iitafile ezibekwe kwindlwane ziya kwenziwa ngendlela efanayo nomzali.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry |
intaka |
@twitter |
Unako kwakhona ukuguqula imibala-ngombhalo okhanyayo kwimvelaphi emnyama-nge .table-dark
.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry |
intaka |
@twitter |
Iinketho zentloko yetheyibhile
Ngokufana neetafile kunye neetafile ezimnyama, sebenzisa iiklasi zesilungisi .thead-light
okanye .thead-dark
ukwenza <thead>
s kubonakale ukukhanya okanye grey emnyama.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry |
intaka |
@twitter |
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry |
intaka |
@twitter |
Imiqolo enemigca
Sebenzisa .table-striped
ukudibanisa zebra-striping kuwo nawuphi na umqolo wetafile ngaphakathi kwe <tbody>
.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry |
intaka |
@twitter |
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry |
intaka |
@twitter |
Itafile enemida
Yongeza .table-bordered
imida kumacala onke etafile kunye neeseli.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
Itafile engenamda
Yongeza .table-borderless
itafile ngaphandle kwemida.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
.table-borderless
inokusetyenziswa nakwiitafile ezimnyama.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
Imiqolo eshukumayo
Yongeza .table-hover
ukwenza imo ye hover kwimigca yetafile ngaphakathi kwe <tbody>
.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
Itafile encinci
Yongeza .table-sm
ukwenza iitafile zihlangane ngakumbi ngokusika i-cell padding kwisiqingatha.
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry intaka |
@twitter |
Iiklasi zomxholo
Sebenzisa iiklasi zomxholo ukufaka imibala kwimigca yetafile okanye iiseli ezizimeleyo.
Iklasi |
Isihloko |
Isihloko |
Iyasebenza |
Iseli |
Iseli |
Ukuhlala kukho |
Iseli |
Iseli |
Amabanga aphantsi |
Iseli |
Iseli |
Eyesibini |
Iseli |
Iseli |
Impumelelo |
Iseli |
Iseli |
Ingozi |
Iseli |
Iseli |
Isilumkiso |
Iseli |
Iseli |
Ulwazi |
Iseli |
Iseli |
Ukukhanya |
Iseli |
Iseli |
Mnyama |
Iseli |
Iseli |
Umehluko wemvelaphi yetheyibhile eqhelekileyo ayifumaneki ngetafile emnyama, nangona kunjalo, ungasebenzisa okubhaliweyo okanye okuluncedo okungemva ukufezekisa izimbo ezifanayo.
# |
Isihloko |
Isihloko |
1 |
Iseli |
Iseli |
2 |
Iseli |
Iseli |
3 |
Iseli |
Iseli |
4 |
Iseli |
Iseli |
5 |
Iseli |
Iseli |
6 |
Iseli |
Iseli |
7 |
Iseli |
Iseli |
8 |
Iseli |
Iseli |
9 |
Iseli |
Iseli |
Ukuhambisa intsingiselo kwiiteknoloji ezincedisayo
Ukusebenzisa umbala ukongeza intsingiselo kubonelela kuphela ngesalathiso esibonakalayo, esingayi kuthunyelwa kubasebenzisi betekhnoloji encedisayo - njengezifundi zesikrini. Qinisekisa ukuba ulwazi olubonakaliswe ngumbala lucacile kumxholo ngokwawo (umzekelo, umbhalo obonakalayo), okanye luqukwe ngezinye iindlela, ezifana nesicatshulwa esongezelelweyo esifihlwe .sr-only
eklasini.
Yenza iitheyibhile eziphendulayo ngokusonga nayiphi na .table
nge .table-responsive{-sm|-md|-lg|-xl}
, ukwenza itafile iskrole ngokuthe tye kwindawo nganye max-width
yokwahlukana ukuya (kodwa kungabandakanywa) 576px, 768px, 992px, kunye ne-1120px, ngokulandelelanayo.
Qaphela ukuba njengoko abakhangeli beencwadi okwangoku bengayixhasi imibuzo yomxholo woluhlu , sisebenza malunga nemida min-
kunye max-
nezimaphambili kunye neendawo zokujonga ezinobubanzi obuqhekekileyo (okwenzeka phantsi kweemeko ezithile kwizixhobo eziphezulu ze-dpi, umzekelo) ngokusebenzisa amaxabiso anochaneka oluphezulu kolu thelekiso. .
Iinkcazelo
Imisebenzi <caption>
efana nesihloko setafile. Inceda abasebenzisi abafunda isikrini ukuba bafumane itafile kwaye baqonde ukuba ingantoni kwaye bathathe isigqibo sokuba bafuna ukuyifunda na.
Uluhlu lwabasebenzisi
# |
Ekuqaleni |
Okokugqibela |
Phatha |
1 |
Phawula |
Otto |
@mdo |
2 |
uYakobi |
Thornton |
@fat |
3 |
Larry |
intaka |
@twitter |
Iitafile eziphendulayo
Iitheyibhile eziphendulayo zivumela iitafile ukuba ziskrolwe ngokuthe tye ngokulula. Yenza nayiphi na itafile iphendule kuzo zonke iindawo zokujonga ngokusonga .table
nge .table-responsive
. Okanye, khetha eyona ndawo iphezulu onokuthi ube netafile ephendulayo ukuya kuthi ga ngoku .table-responsive{-sm|-md|-lg|-xl}
.
Ukunqunyulwa ngokuthe nkqo/ukunciphisa
Iitheyibhile eziphendulayo zisebenzisa overflow-y: hidden
i-, ekhuphela nawuphi na umxholo ongaphaya komzantsi okanye kumphetho wetafile. Ngokukodwa, oku kunokuqhawula iimenyu ezihlayo kunye nezinye iiwijethi zomntu wesithathu.
Isoloko iphendula
Kuzo zonke iindawo zokuphumla, sebenzisa .table-responsive
iitafile zokuskrola ngokuthe tye.
# |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
1 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
2 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
3 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Breakpoint ethile
Sebenzisa .table-responsive{-sm|-md|-lg|-xl}
njengoko kufuneka ukwenza iitafile eziphendulayo ukuya kwindawo ethile yoqhawulo. Ukusuka kuloo ndawo yokuqhekeka ukuya phezulu, itafile iya kuziphatha ngokwesiqhelo kwaye ingasondeli ngokuthe tye.
Ezi theyibhile zinokubonakala zaphukile de izimbo zazo zokuphendula zisebenze kububanzi obuthile bendawo yokujonga.
# |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
1 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
2 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
3 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
# |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
1 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
2 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
3 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
# |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
1 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
2 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
3 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
# |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
Isihloko |
1 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
2 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
3 |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |
Iseli |