SourceAmathebula
Amadokhumenti nezibonelo zokukhetha ukungena kwisitayela samathebula (uma kubhekwa ukusetshenziswa kwawo okuvame kakhulu kuma-plugin e-JavaScript) nge-Bootstrap.
Ngenxa yokusetshenziswa kabanzi kwamathebula kuwo wonke amawijethi ezinkampani zangaphandle njengamakhalenda nezikhethi zezinsuku, siklame amathebula ethu ukuthi angene . Vele ungeze ikilasi lesisekelo .table
kunoma iyiphi <table>
, bese unweba ngezitayela zangokwezifiso noma amakilasi ethu ahlukahlukene afakiwe ahlanganisiwe.
Usebenzisa imakhaphu yethebula eyisisekelo, nansi indlela .table
amathebula asekelwe ngayo abukeka ngayo ku-Bootstrap. Zonke izitayela zethebula zizuzwa njengefa ku-Bootstrap 4 , okusho ukuthi noma yimaphi amathebula afakwe esidlekeni azobhalwa ngendlela efanayo neyomzali.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry |
uNyoni |
@twitter |
Ungakwazi futhi ukuguqula imibala—ngombhalo okhanyayo kungemuva elimnyama—nge- .table-dark
.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry |
uNyoni |
@twitter |
Izinketho zekhanda lethebula
Ngokufana namathebula namathebula amnyama, sebenzisa amakilasi okulungisa .thead-light
noma .thead-dark
ukwenza u- <thead>
s abonakale ekhanyayo noma empunga emnyama.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry |
uNyoni |
@twitter |
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry |
uNyoni |
@twitter |
Sebenzisa .table-striped
ukwengeza i-zebra-striping kunoma yimuphi umugqa wethebula ngaphakathi kwe- <tbody>
.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry |
uNyoni |
@twitter |
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry |
uNyoni |
@twitter |
Engeza .table-bordered
imingcele kuzo zonke izinhlangothi zetafula namaseli.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
Engeza .table-borderless
kutafula elingenayo imingcele.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
.table-borderless
ingasetshenziswa futhi ematafuleni amnyama.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
Engeza .table-hover
ukuze unike amandla isimo sokuhambisa phezulu emigqeni yethebula ngaphakathi kwe- <tbody>
.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
Engeza .table-sm
ukuze wenze amatafula ahlangane kakhudlwana ngokusika ama-cell padding phakathi.
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry Inyoni |
@twitter |
Sebenzisa amakilasi anomongo ukuze ufake imibala yemigqa yethebula noma amaseli ngamanye.
Ikilasi |
Isihloko |
Isihloko |
Iyasebenza |
Iseli |
Iseli |
Okuzenzakalelayo |
Iseli |
Iseli |
Okuyinhloko |
Iseli |
Iseli |
Okwesibili |
Iseli |
Iseli |
Impumelelo |
Iseli |
Iseli |
Ingozi |
Iseli |
Iseli |
Isexwayiso |
Iseli |
Iseli |
Ulwazi |
Iseli |
Iseli |
Ukukhanya |
Iseli |
Iseli |
Kumnyama |
Iseli |
Iseli |
Okuhlukile kwengemuva lethebula elivamile akutholakali ngethebula elimnyama, nokho-ke, ungasebenzisa umbhalo noma izinto ezingemuva ukuze uzuze izitayela 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 |
Ukudlulisa incazelo kubuchwepheshe obusizayo
Ukusebenzisa umbala ukwengeza incazelo kunikeza kuphela inkomba ebonakalayo, engeke idluliselwe kubasebenzisi bobuchwepheshe obusizayo - njengezifundi zesikrini. Qinisekisa ukuthi ulwazi olushiwo umbala lusobala kokuqukethwe ngokwako (isb umbhalo obonakalayo), noma lufakwe ngezinye izindlela, njengombhalo owengeziwe ofihliwe .sr-only
nekilasi.
Dala amathebula aphendulayo ngokugoqa noma yimaphi .table
ngokuthi .table-responsive{-sm|-md|-lg|-xl}
, wenze ithebula lisonge ngokuvundlile endaweni ngayinye max-width
yokuhlukana kufika (kodwa ungafaki) 576px, 768px, 992px, kanye no-1120px, ngokulandelana.
Qaphela ukuthi njengoba iziphequluli okwamanje zingayisekeli imibuzo yokuqukethwe kobubanzi , sisebenza eduze kwemikhawulo min-
kanye max-
neziqalo nezinkundla zokubuka ezinobubanzi obuyingxenyana (okungenzeka ngaphansi kwezimo ezithile kumadivayisi e-dpi ephezulu, isibonelo) ngokusebenzisa amanani anembe kakhulu kulokhu kuqhathanisa. .
Isebenza <caption>
njengesihloko setafula. Isiza abasebenzisi abanezifundi zesikrini ukuthi bathole ithebula futhi baqonde ukuthi limayelana nani futhi banqume ukuthi bafuna ukulifunda yini.
Uhlu lwabasebenzisi
# |
Okokuqala |
Okokugcina |
Bamba |
1 |
Maka |
Otto |
@mdo |
2 |
uJakobe |
Thornton |
@amafutha |
3 |
Larry |
uNyoni |
@twitter |
Amathebula aphendulayo avumela amathebula ukuthi asongwe ngokuvundlile kalula. Yenza noma yiliphi ithebula liphendule kuzo zonke izinkundla zokubuka ngokusonga .table
ngokuthi .table-responsive
. Noma, khetha indawo enkulu yokunqamula lapho ungathola khona ithebula eliphendulayo ngokusebenzisa .table-responsive{-sm|-md|-lg|-xl}
.
Ukusika okuqondile/ukunciphisa
Amathebula aphendulayo asebenzisa overflow-y: hidden
okuthi , okusika noma yikuphi okuqukethwe okudlulela ngale kwangaphansi noma imiphetho ephezulu yethebula. Ikakhulukazi, lokhu kunganqamula amamenyu okwehlayo namanye amawijethi ezinkampani zangaphandle.
Kuwo wonke ama-breakpoint, sebenzisa .table-responsive
amathebula okuskrola avundlile.
# |
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 |
Sebenzisa .table-responsive{-sm|-md|-lg|-xl}
njengoba kudingeka ukuze udale amathebula asabelayo afinyelele endaweni ethile yokuhlukana. Kusukela kuleyo ndawo yokuhlukana kuya phezulu, ithebula lizoziphatha ngendlela evamile futhi lingaskroli ngokuvundlile.
Lawa mathebula angase abonakale ephukile kuze kube yilapho izitayela zawo zokusabela zisebenza kububanzi obuthile bokubuka.
# |
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 |