Nyaraka na mifano ya kuchagua kuingia kwa mtindo wa jedwali (kwa kuzingatia matumizi yao ya kawaida katika programu jalizi za JavaScript) na Bootstrap.
Mifano
Kwa sababu ya kuenea kwa matumizi ya majedwali kwenye wijeti za watu wengine kama vile kalenda na viteuzi vya tarehe, tumeunda majedwali yetu kuwa ya kuchagua kuingia . Ongeza tu darasa la msingi .tablekwa any <table>, kisha upanue kwa mitindo maalum au madarasa yetu mbalimbali ya kurekebisha yaliyojumuishwa.
Kwa kutumia lebo ya msingi zaidi ya jedwali, hivi ndivyo .tablemajedwali-msingi yanavyoonekana kwenye Bootstrap. Mitindo yote ya jedwali imerithiwa katika Bootstrap 4 , kumaanisha kuwa jedwali zozote zilizowekwa kwenye kiota zitawekwa kwa mtindo sawa na mzazi.
Ongeza .table-borderedkwa mipaka pande zote za jedwali na seli.
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@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>
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@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>
Jedwali lisilo na mipaka
Ongeza .table-borderlesskwa meza bila mipaka.
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@twitter
<tableclass="table table-borderless"><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>
.table-borderlesspia inaweza kutumika kwenye meza za giza.
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@twitter
<tableclass="table table-borderless 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>
Safu zinazoweza kusongeshwa
Ongeza .table-hoverili kuwezesha hali ya kuelea kwenye safu mlalo za jedwali ndani ya <tbody>.
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@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>
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@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>
Jedwali ndogo
Ongeza .table-smili kufanya meza kushikana zaidi kwa kukata pedi za seli katikati.
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@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>
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry Ndege
@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>
Madarasa ya muktadha
Tumia madarasa ya muktadha kupaka rangi safu mlalo za jedwali au seli mahususi.
Darasa
Kichwa
Kichwa
Inayotumika
Kiini
Kiini
Chaguomsingi
Kiini
Kiini
Msingi
Kiini
Kiini
Sekondari
Kiini
Kiini
Mafanikio
Kiini
Kiini
Hatari
Kiini
Kiini
Onyo
Kiini
Kiini
Habari
Kiini
Kiini
Mwanga
Kiini
Kiini
Giza
Kiini
Kiini
<!-- On rows --><trclass="table-active">...</tr><trclass="table-primary">...</tr><trclass="table-secondary">...</tr><trclass="table-success">...</tr><trclass="table-danger">...</tr><trclass="table-warning">...</tr><trclass="table-info">...</tr><trclass="table-light">...</tr><trclass="table-dark">...</tr><!-- On cells (`td` or `th`) --><tr><tdclass="table-active">...</td><tdclass="table-primary">...</td><tdclass="table-secondary">...</td><tdclass="table-success">...</td><tdclass="table-danger">...</td><tdclass="table-warning">...</td><tdclass="table-info">...</td><tdclass="table-light">...</td><tdclass="table-dark">...</td></tr>
Vibadala vya mandharinyuma vya kawaida vya jedwali havipatikani na jedwali jeusi, hata hivyo, unaweza kutumia maandishi au huduma za usuli kufikia mitindo sawa.
#
Kichwa
Kichwa
1
Kiini
Kiini
2
Kiini
Kiini
3
Kiini
Kiini
4
Kiini
Kiini
5
Kiini
Kiini
6
Kiini
Kiini
7
Kiini
Kiini
8
Kiini
Kiini
9
Kiini
Kiini
<!-- On rows --><trclass="bg-primary">...</tr><trclass="bg-success">...</tr><trclass="bg-warning">...</tr><trclass="bg-danger">...</tr><trclass="bg-info">...</tr><!-- On cells (`td` or `th`) --><tr><tdclass="bg-primary">...</td><tdclass="bg-success">...</td><tdclass="bg-warning">...</td><tdclass="bg-danger">...</td><tdclass="bg-info">...</td></tr>
Kuwasilisha maana kwa teknolojia za usaidizi
Kutumia rangi ili kuongeza maana hutoa tu kielelezo cha kuona, ambacho hakitawasilishwa kwa watumiaji wa teknolojia saidizi - kama vile visoma skrini. Hakikisha kwamba maelezo yanayoashiriwa na rangi ni dhahiri kutoka kwa maudhui yenyewe (km maandishi yanayoonekana), au yanajumuishwa kupitia njia mbadala, kama vile maandishi ya ziada yaliyofichwa na .sr-onlydarasa.
Unda majedwali yanayojibu kwa kukunja yoyote .tablena .table-responsive{-sm|-md|-lg|-xl}, kufanya jedwali kusogeza kwa mlalo katika kila max-widthsehemu ya kukatika hadi (lakini bila kujumuisha) 576px, 768px, 992px, na 1120px, mtawalia.
Kumbuka kuwa kwa kuwa vivinjari
havitumii maswali ya muktadha wa anuwai kwa sasa , tunashughulikia vizuizi
min-na max-viambishi awali na tovuti za kutazama zenye upana wa sehemu (ambayo inaweza kutokea chini ya hali fulani kwenye vifaa vya juu vya dpi, kwa mfano) kwa kutumia thamani kwa usahihi wa juu kwa ulinganisho huu. .
Manukuu
Hufanya <caption>kazi kama kichwa cha jedwali. Husaidia watumiaji walio na visoma skrini kupata jedwali na kuelewa inahusu nini na kuamua kama wanataka kuisoma.
Orodha ya watumiaji
#
Kwanza
Mwisho
Kushughulikia
1
Weka alama
Otto
@mdo
2
Yakobo
Thornton
@mafuta
3
Larry
ndege
@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>
Majedwali ya mwitikio
Majedwali jibu huruhusu jedwali kusongeshwa kwa mlalo kwa urahisi. Fanya jedwali lolote lijisikie kwenye tovuti zote za kutazama kwa kufunga .tablena .table-responsive. Au, chagua kikomo cha juu zaidi ambacho unaweza kuwa na jedwali la kuitikia hadi kwa kutumia .table-responsive{-sm|-md|-lg|-xl}.
Ukataji/upunguzaji wima
Majedwali jibu hutumia overflow-y: hidden, ambayo huondoa maudhui yoyote ambayo huenda zaidi ya kingo za chini au za juu za jedwali. Hasa, hii inaweza kupunguza menyu kunjuzi na wijeti zingine za wahusika wengine.
Daima msikivu
Katika kila sehemu ya kukatiza, tumia .table-responsivekwa majedwali ya kusogeza kwa mlalo.
Tumia .table-responsive{-sm|-md|-lg|-xl}inavyohitajika ili kuunda majedwali jibu hadi sehemu fulani ya kukanusha. Kutoka kwa sehemu hiyo na juu, jedwali litafanya kazi kama kawaida na sio kusogea kwa usawa.
Majedwali haya yanaweza kuonekana kuwa yamevunjwa hadi mitindo yao ya kuitikia itumike katika upana mahususi wa kituo cha kutazama.