SourceMatebulo
Zolemba ndi zitsanzo zamakongoletsedwe a matebulo (kutengera momwe amagwiritsidwira ntchito mu JavaScript mapulagini) ndi Bootstrap.
Zitsanzo
Chifukwa cha kuchuluka kwa matebulo pama widget a gulu lachitatu monga makalendala ndi osankha masiku, tapanga matebulo athu kuti asalowemo . Ingowonjezerani kalasi yoyambira .table
ku iliyonse <table>
, kenako onjezerani masitayelo anu kapena makalasi athu osiyanasiyana ophatikizidwa.
Pogwiritsa ntchito zolembera zoyambira kwambiri patebulo, nayi momwe .table
-matebulo amawonekera mu Bootstrap. Mitundu yonse ya matebulo imatengera ku Bootstrap 4 , kutanthauza kuti matebulo aliwonse omwe ali ndi zisa adzalembedwa mofanana ndi kholo.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry |
Mbalame |
@twitter |
Mutha kutembenuzanso mitunduyo ndi mawu opepuka pamasamba akuda ndi .table-dark
.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry |
Mbalame |
@twitter |
Zosankha zamutu wa tebulo
Mofanana ndi matebulo ndi matebulo akuda, gwiritsani ntchito makalasi osintha .thead-light
kapena .thead-dark
kupanga <thead>
s kuwoneka yopepuka kapena imvi.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry |
Mbalame |
@twitter |
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry |
Mbalame |
@twitter |
Mizere yamizeremizere
Gwiritsani .table-striped
ntchito kuwonjezera mbidzi-mizere pamzere uliwonse wa tebulo mkati mwa <tbody>
.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry |
Mbalame |
@twitter |
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry |
Mbalame |
@twitter |
Gome lokhala ndi malire
Onjezani .table-bordered
malire kumbali zonse za tebulo ndi ma cell.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
Gome lopanda malire
Onjezani .table-borderless
pa tebulo lopanda malire.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
.table-borderless
itha kugwiritsidwanso ntchito pamatebulo akuda.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
Mizere yosunthika
Onjezani .table-hover
kuti mutsegule chiwongolero pamizere ya tebulo mkati mwa <tbody>
.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
Tebulo laling'ono
Onjezani .table-sm
kuti ma tebulo azikhala ophatikizika podula ma cell padding pakati.
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry Mbalame |
@twitter |
Maphunziro a Contextual
Gwiritsani ntchito makalasi okhazikika kuti musankhe mizere yamatebulo kapena ma cell amodzi.
Kalasi |
Mutu |
Mutu |
Yogwira |
Selo |
Selo |
Zosasintha |
Selo |
Selo |
Pulayimale |
Selo |
Selo |
Sekondale |
Selo |
Selo |
Kupambana |
Selo |
Selo |
Ngozi |
Selo |
Selo |
Chenjezo |
Selo |
Selo |
Zambiri |
Selo |
Selo |
Kuwala |
Selo |
Selo |
Chakuda |
Selo |
Selo |
Zosintha zanthawi zonse patebulo sizipezeka ndi tebulo lakuda, komabe, mutha kugwiritsa ntchito zolemba kapena zakumbuyo kuti mukwaniritse masitayelo ofanana.
# |
Mutu |
Mutu |
1 |
Selo |
Selo |
2 |
Selo |
Selo |
3 |
Selo |
Selo |
4 |
Selo |
Selo |
5 |
Selo |
Selo |
6 |
Selo |
Selo |
7 |
Selo |
Selo |
8 |
Selo |
Selo |
9 |
Selo |
Selo |
Kupereka tanthauzo ku matekinoloje othandizira
Kugwiritsa ntchito utoto kuti muwonjezere tanthauzo kumangopereka chithunzithunzi, chomwe sichidzaperekedwa kwa ogwiritsa ntchito matekinoloje othandizira - monga owerenga pazenera. Onetsetsani kuti zomwe zatchulidwa ndi mtunduwo zikuwonekera kuchokera pazomwe zili (monga zolemba zowonekera), kapena zikuphatikizidwa ndi njira zina, monga zolemba zina zobisika ndi .sr-only
kalasi.
Pangani matebulo omvera mwa kukulunga iliyonse .table
ndi .table-responsive{-sm|-md|-lg|-xl}
, ndikupanga tebulo kuti liziyenda mozungulira pagawo lililonse max-width
mpaka (koma osaphatikiza) 576px, 768px, 992px, ndi 1120px, motsatana.
Zindikirani kuti popeza asakatuli sakuthandiza pano mafunso osiyanasiyana , timagwiritsa ntchito malire a ma min-
prefixes max-
ndi mawonedwe okhala ndi m'lifupi mwake (omwe amatha kuchitika pazida zamtundu wapamwamba wa dpi, mwachitsanzo) pogwiritsa ntchito milingo yolondola kwambiri poyerekezera izi. .
Mawu omasulira
A <caption>
amagwira ntchito ngati mutu wa tebulo. Zimathandizira ogwiritsa ntchito omwe ali ndi zowonera kuti apeze tebulo ndikumvetsetsa zomwe akunena ndikusankha ngati akufuna kuliwerenga.
Mndandanda wa ogwiritsa ntchito
# |
Choyamba |
Pomaliza |
Chogwirizira |
1 |
Mark |
Otto |
@mdo |
2 |
Yakobo |
Thornton |
@mafuta |
3 |
Larry |
Mbalame |
@twitter |
Matebulo omvera
Matebulo omvera amalola kuti matebulo azipukutidwa mopingasa mosavuta. Pangani tebulo lililonse kuti liziyankha pamawonekedwe onse pokulunga .table
ndi .table-responsive
. Kapena, sankhani malo odumpha kwambiri omwe mungakhale ndi tebulo lomvera mpaka kugwiritsa ntchito .table-responsive{-sm|-md|-lg|-xl}
.
Kudula molunjika/kudulira
Matebulo omvera amagwiritsa ntchito overflow-y: hidden
, yomwe imadula chilichonse chomwe chimadutsa pansi kapena m'mphepete mwa tebulo. Makamaka, izi zitha kudulira mindandanda yotsitsa ndi ma widget ena a chipani chachitatu.
Nthawi zonse amayankha
Pamalo oduka aliwonse, gwiritsani ntchito .table-responsive
magome oyenda mopingasa.
# |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
1 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
2 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
3 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Breakpoint mwachindunji
Gwiritsani ntchito .table-responsive{-sm|-md|-lg|-xl}
ngati pakufunika kuti mupange matebulo omvera mpaka pagawo linalake. Kuyambira pomwepa ndikupita mmwamba, tebulo liziyenda bwino osati kusuntha mopingasa.
Matebulowa atha kuwoneka osweka mpaka masitayilo awo amayankhidwa atagwiritsidwa ntchito pamawonekedwe enaake.
# |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
1 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
2 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
3 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
# |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
1 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
2 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
3 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
# |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
1 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
2 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
3 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
# |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
Mutu |
1 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
2 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
3 |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |
Selo |