Takaddun bayanai da misalai don ficewa salon salon tebur (idan aka ba su yawan amfani da su a cikin plugins JavaScript) tare da Bootstrap.
Misalai
Saboda yaɗuwar amfani da tebura a cikin widgets na ɓangare na uku kamar kalanda da masu zaɓen kwanan wata, mun ƙirƙira teburin mu don shiga . Kawai ƙara ajin tushe .tablezuwa kowane <table>, sannan ƙara tare da salo na al'ada ko azuzuwan gyare-gyare daban-daban na mu.
Yin amfani da mafi mahimmancin alamar tebur, ga yadda .tabletebur na tushen ke kallo a cikin Bootstrap. An gaji duk salon tebur a cikin Bootstrap 4 , ma'ana kowane tebur na gida za a tsara shi daidai da iyaye.
Kama da teburi da teburi masu duhu, yi amfani da azuzuwan masu gyara .thead-lightko .thead-darkdon sanya <thead>s ya zama haske ko launin toka mai duhu.
Ƙara .table-bordereddon iyakoki a duk bangarorin tebur da sel.
#
Na farko
Karshe
Hannu
1
Alama
Otto
@mdo
2
Yakubu
Thornton
@mai
3
Larry the Bird
@twitter
<tableclass="table table-bordered"><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbody><tr><thscope="row">1</th><td>Mark</td><td>Otto</td><td>@mdo</td></tr><tr><thscope="row">2</th><td>Jacob</td><td>Thornton</td><td>@fat</td></tr><tr><thscope="row">3</th><tdcolspan="2">Larry the Bird</td><td>@twitter</td></tr></tbody></table>
#
Na farko
Karshe
Hannu
1
Alama
Otto
@mdo
2
Yakubu
Thornton
@mai
3
Larry the Bird
@twitter
<tableclass="table table-bordered table-dark"><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbody><tr><thscope="row">1</th><td>Mark</td><td>Otto</td><td>@mdo</td></tr><tr><thscope="row">2</th><td>Jacob</td><td>Thornton</td><td>@fat</td></tr><tr><thscope="row">3</th><tdcolspan="2">Larry the Bird</td><td>@twitter</td></tr></tbody></table>
Layukan masu shawagi
Ƙara .table-hoverdon kunna yanayin jujjuyawa akan layuka na tebur a cikin <tbody>.
#
Na farko
Karshe
Hannu
1
Alama
Otto
@mdo
2
Yakubu
Thornton
@mai
3
Larry the Bird
@twitter
<tableclass="table table-hover"><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbody><tr><thscope="row">1</th><td>Mark</td><td>Otto</td><td>@mdo</td></tr><tr><thscope="row">2</th><td>Jacob</td><td>Thornton</td><td>@fat</td></tr><tr><thscope="row">3</th><tdcolspan="2">Larry the Bird</td><td>@twitter</td></tr></tbody></table>
#
Na farko
Karshe
Hannu
1
Alama
Otto
@mdo
2
Yakubu
Thornton
@mai
3
Larry the Bird
@twitter
<tableclass="table table-hover table-dark"><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbody><tr><thscope="row">1</th><td>Mark</td><td>Otto</td><td>@mdo</td></tr><tr><thscope="row">2</th><td>Jacob</td><td>Thornton</td><td>@fat</td></tr><tr><thscope="row">3</th><tdcolspan="2">Larry the Bird</td><td>@twitter</td></tr></tbody></table>
Ƙananan tebur
Ƙara .table-smdon sanya tebur ɗin ya zama ƙarami ta hanyar yankan tantanin halitta a rabi.
#
Na farko
Karshe
Hannu
1
Alama
Otto
@mdo
2
Yakubu
Thornton
@mai
3
Larry the Bird
@twitter
<tableclass="table table-sm"><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbody><tr><thscope="row">1</th><td>Mark</td><td>Otto</td><td>@mdo</td></tr><tr><thscope="row">2</th><td>Jacob</td><td>Thornton</td><td>@fat</td></tr><tr><thscope="row">3</th><tdcolspan="2">Larry the Bird</td><td>@twitter</td></tr></tbody></table>
#
Na farko
Karshe
Hannu
1
Alama
Otto
@mdo
2
Yakubu
Thornton
@mai
3
Larry the Bird
@twitter
<tableclass="table table-sm table-dark"><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbody><tr><thscope="row">1</th><td>Mark</td><td>Otto</td><td>@mdo</td></tr><tr><thscope="row">2</th><td>Jacob</td><td>Thornton</td><td>@fat</td></tr><tr><thscope="row">3</th><tdcolspan="2">Larry the Bird</td><td>@twitter</td></tr></tbody></table>
Azuzuwan yanayi
Yi amfani da azuzuwan mahallin don canza launi na tebur ko sel guda ɗaya.
Class
Jagora
Jagora
Mai aiki
Cell
Cell
Default
Cell
Cell
Firamare
Cell
Cell
Sakandare
Cell
Cell
Nasara
Cell
Cell
hadari
Cell
Cell
Gargadi
Cell
Cell
Bayani
Cell
Cell
Haske
Cell
Cell
Duhu
Cell
Cell
Ba a samun bambance-bambancen bangon tebur na yau da kullun tare da tebur mai duhu, duk da haka, kuna iya amfani da rubutu ko kayan aikin bango don cimma salo iri ɗaya.
#
Jagora
Jagora
1
Cell
Cell
2
Cell
Cell
3
Cell
Cell
4
Cell
Cell
5
Cell
Cell
6
Cell
Cell
7
Cell
Cell
8
Cell
Cell
9
Cell
Cell
Isar da ma'ana ga fasahar taimako
Yin amfani da launi don ƙara ma'ana kawai yana ba da alamar gani, wanda ba za a isar da shi ga masu amfani da fasahar taimako ba - kamar masu karanta allo. Tabbatar cewa bayanin da launi ke nunawa ko dai a bayyane yake daga abun cikin kanta (misali rubutun bayyane), ko kuma an haɗa shi ta hanyar madadin, kamar ƙarin rubutu da aka ɓoye tare da .sr-onlyajin.
Ƙirƙirar tebur masu amsawa ta hanyar nannade kowane .tabletare da .table-responsive{-sm|-md|-lg|-xl}, yin teburin gungurawa a kwance a kowane wurin max-widthkarya har zuwa (amma ban haɗa da) 576px, 768px, 992px, da 1120px, bi da bi.
Lura cewa tun da masu bincike ba su goyan bayan tambayoyin mahallin kewayo a halin yanzu , muna aiki a kusa da iyakoki min-da max-prefixes da kallon kallo tare da faɗuwar juzu'i (wanda zai iya faruwa a ƙarƙashin wasu yanayi akan manyan na'urorin dpi, alal misali) ta amfani da ƙima tare da daidaito mafi girma don waɗannan kwatancen. .
Kalmomi
Ayyuka <caption>kamar tafiya zuwa tebur. Yana taimaka wa masu amfani da masu karanta allo don nemo tebur kuma su fahimci abin da ke cikinsa kuma su yanke shawarar idan suna son karanta shi.
Jerin masu amfani
#
Na farko
Karshe
Hannu
1
Alama
Otto
@mdo
2
Yakubu
Thornton
@mai
3
Larry
Tsuntsu
@twitter
<tableclass="table"><caption>List of users</caption><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbody><tr><thscope="row">1</th><td>Mark</td><td>Otto</td><td>@mdo</td></tr><tr><thscope="row">2</th><td>Jacob</td><td>Thornton</td><td>@fat</td></tr><tr><thscope="row">3</th><td>Larry</td><td>the Bird</td><td>@twitter</td></tr></tbody></table>
Tables masu amsawa
Tables masu amsawa suna ba da damar gungurawa tebur a kwance cikin sauƙi. Sanya kowane tebur mai amsawa a duk wuraren kallo ta hanyar nannade .tableda .table-responsive. Ko, zaɓi matsakaicin matsakaicin wurin da za a sami tebur mai amsawa da shi ta amfani da .table-responsive{-sm|-md|-lg|-xl}.
Yanke/tsatsewa tsaye
Tables masu amsawa suna amfani da overflow-y: hidden, wanda ke cire duk wani abun ciki wanda ya wuce ƙasa ko saman saman teburin. Musamman, wannan na iya kashe menus na zazzagewa da sauran widgets na ɓangare na uku.
Koyaushe mai amsawa
A ko'ina cikin kowane wurin hutu, yi amfani .table-responsiveda teburin gungurawa a kwance.
#
Jagora
Jagora
Jagora
Jagora
Jagora
Jagora
Jagora
Jagora
Jagora
1
Cell
Cell
Cell
Cell
Cell
Cell
Cell
Cell
Cell
2
Cell
Cell
Cell
Cell
Cell
Cell
Cell
Cell
Cell
3
Cell
Cell
Cell
Cell
Cell
Cell
Cell
Cell
Cell
Musamman Breakpoint
Yi amfani .table-responsive{-sm|-md|-lg|-xl}da yadda ake buƙata don ƙirƙirar tebur masu amsawa har zuwa wani wuri na musamman. Tun daga wancan lokacin zuwa sama, tebur ɗin zai kasance kamar yadda aka saba kuma ba gungurawa a kwance ba.