Nuŋlɔɖiwo kple kpɔɖeŋuwo na kplɔ̃wo ƒe atsyãwɔwɔ ƒe tiatiawɔwɔ (le woƒe zazã si bɔ le JavaScript ƒe kpeɖeŋutɔwo me ta) kple Bootstrap.
Le axa sia dzi
Kpɔɖeŋunyagbɔgblɔ
Le nusiwo wozãna le afisiafi <table>le ame etɔ̃lia ƒe widgetwo abe ɣletigbalẽwo kple ŋkeke tiatiawɔlawo ene ta la, Bootstrap ƒe kplɔ̃wo nye tiatiawɔwɔ . Tsɔ gɔmeɖoanyi ƒe hatsotso la kpe .tableɖe ɖesiaɖe ŋu <table>, emegbe nàkekee ɖe enu kple míaƒe tiatiawɔblɔɖe ƒe hatsotsowo alo atsyã tɔxɛwo. Womenyi kplɔ̃ ƒe atsyãwo katã ƒe dome le Bootstrap me o, si fia be woateŋu awɔ kplɔ̃ ɖesiaɖe si wotsɔ ƒo ƒui ƒe atsyã le eɖokui si tso dzila gbɔ.
Ne èzã kplɔ̃ ƒe dzesi vevitɔ kekeake la, alesi .table-dzi kplɔ̃wo le le Bootstrap me enye si.
# .
Gbã
Nᴐ anyi didi
Alᴐ
1.
Marko
Otto ƒe nyawo
@mdo dzi
2.
Yakob
Thornton ƒe ŋkɔ
@da ami
3.
Larry Xevi la
@twitter dzi
<tableclass="table"><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>
Vovototowo
Zã nya siwo ƒo xlãe ƒe klasswo tsɔ de ama kplɔ̃wo, kplɔ̃wo ƒe fliwo alo lãmenugbagbevi ɖekaɖekawo.
Nusrɔ̃ƒe
Tanya ƒe tanya
Tanya ƒe tanya
Gᴐmedzeƒe
Gaxɔ
Gaxɔ
Gɔmedzeƒe
Gaxɔ
Gaxɔ
Sekɛndrisuku
Gaxɔ
Gaxɔ
Dzidzedzekpᴐkpᴐ
Gaxɔ
Gaxɔ
Ŋɔdzi
Gaxɔ
Gaxɔ
Kpɔnyuiedodo
Gaxɔ
Gaxɔ
Nyatakaka
Gaxɔ
Gaxɔ
Kekeli
Gaxɔ
Gaxɔ
Nyrɔ
Gaxɔ
Gaxɔ
<!-- On tables --><tableclass="table-primary">...</table><tableclass="table-secondary">...</table><tableclass="table-success">...</table><tableclass="table-danger">...</table><tableclass="table-warning">...</table><tableclass="table-info">...</table><tableclass="table-light">...</table><tableclass="table-dark">...</table><!-- On rows --><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-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>
Gɔmesese nana mɔ̃ɖaŋununya siwo kpena ɖe ame ŋu
Amadede zazã atsɔ akpe ɖe gɔmesese ŋu koe naa nukpɔkpɔ ƒe dzesi aɖe, si womagblɔ na kpekpeɖeŋunamɔ̃wo zazãlawo o – abe screen readers ene. Kpɔ egbɔ be nyatakaka siwo wotsɔ amadedea de dzesii la dze ƒã tso emenyawo ŋutɔ me (le kpɔɖeŋu me, nuŋɔŋlɔ si wokpɔna), alo wotsɔe de eme to mɔnu bubuwo dzi, abe nuŋɔŋlɔ bubu siwo woɣla ɖe .visually-hiddenklass la ŋu ene.
Kplɔ̃ siwo dzi woŋlɔ nu ɖo
Fli siwo ŋu fli le
Zãe nàtsɔ .table-stripedakpe zebra-striping ɖe kplɔ̃ ƒe fli ɖesiaɖe si le <tbody>.
Míedzea egɔme kple table cell ƒe megbenya ɖoɖo kple --bs-table-bgcustom property. Emegbe kplɔ̃ ƒe tɔtrɔwo katã ɖoa nɔnɔme tɔxɛ ma be wòade amadede kplɔ̃ ƒe lãmenugbagbeviawo me. To mɔ sia dzi la, míegena ɖe kuxi me ne wozã amadede siwo me kɔ afã kple afã abe kplɔ̃ ƒe megbenyawo ene o.
Emegbe míetsɔa inset box shadow kpena ɖe table cells ŋu kple box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);to layer ɖe ɖesiaɖe si woɖo la tame background-color. Esi míezãa kaka gã aɖe eye míezãa blur aɖeke o ta la, amadedea anye monotone. Esi wònye --bs-table-accent-bgbe womeɖoe le gɔmedzedzea me o ta la, aɖaka ƒe vɔvɔli si woɖo ɖi mele mía si o.
Ne wotsɔ .table-striped, .table-hoveralo .table-activeklasswo kpe ɖe eŋu la, --bs-table-accent-bgwoɖoa amadede si me kɔ afã kple afã be wòade amadede megbe la.
Le kplɔ̃ ƒe tɔtrɔ ɖesiaɖe gome la, míewɔa --bs-table-accent-bgamadede si me vovototo gãtɔ kekeake le le amadede ma nu. Le kpɔɖeŋu me, gbeɖiɖi ƒe amadede na .table-primaryla do viviti wu esime .table-darkgbeɖiɖi ƒe amadede si me kɔ wu le esi.
Wowɔa nuŋɔŋlɔ kple liƒo ƒe amadedewo le mɔ ɖeka nu, eye woƒe amadedewo nye domenyinyi le gɔmedzedzea me.
Table cells of <thead>nɔa tsitrenu ɣesiaɣi ɖe ete. Table cells in <tbody>domenyi woƒe alignment tso <table>eye woɖo wo ɖe the top la default. Zã vertical align classes nàtsɔ agbugbɔ aɖoe ɖe ɖoɖo nu le afisi wòhiã le.
Tanya 1 lia
Tanya 2 lia
Tanya 3 lia
Tanya 4 lia
Lãmenugbagbevi sia nyi dome vertical-align: middle;tso kplɔ̃a dzi
Lãmenugbagbevi sia nyi dome vertical-align: middle;tso kplɔ̃a dzi
Lãmenugbagbevi sia nyi dome vertical-align: middle;tso kplɔ̃a dzi
Esia nye teƒeɖoɖo ƒe nuŋɔŋlɔ aɖewo le afisia, si woɖo be wòaxɔ teƒe si le tsitrenu vie ŋutɔ, be woatsɔ aɖe alesi tsitrenu ƒe ɖoɖowɔwɔ wɔa dɔe le lãmenugbagbevi siwo do ŋgɔ me la afia.
Lãmenugbagbevi sia nyi dome vertical-align: bottom;tso kplɔ̃a ƒe fli me
Lãmenugbagbevi sia nyi dome vertical-align: bottom;tso kplɔ̃a ƒe fli me
Lãmenugbagbevi sia nyi dome vertical-align: bottom;tso kplɔ̃a ƒe fli me
Esia nye teƒeɖoɖo ƒe nuŋɔŋlɔ aɖewo le afisia, si woɖo be wòaxɔ teƒe si le tsitrenu vie ŋutɔ, be woatsɔ aɖe alesi tsitrenu ƒe ɖoɖowɔwɔ wɔa dɔe le lãmenugbagbevi siwo do ŋgɔ me la afia.
Lãmenugbagbevi sia nyi dome vertical-align: middle;tso kplɔ̃a dzi
Lãmenugbagbevi sia nyi dome vertical-align: middle;tso kplɔ̃a dzi
Lãmenugbagbevi sia le ɖoɖo nu ɖe etame.
Esia nye teƒeɖoɖo ƒe nuŋɔŋlɔ aɖewo le afisia, si woɖo be wòaxɔ teƒe si le tsitrenu vie ŋutɔ, be woatsɔ aɖe alesi tsitrenu ƒe ɖoɖowɔwɔ wɔa dɔe le lãmenugbagbevi siwo do ŋgɔ me la afia.
<divclass="table-responsive"><tableclass="table align-middle"><thead><tr>
...
</tr></thead><tbody><tr>
...
</tr><trclass="align-bottom">
...
</tr><tr><td>...</td><td>...</td><tdclass="align-top">This cell is aligned to the top.</td><td>...</td></tr></tbody></table></div>
Atɔwɔwɔ
Liƒo ƒe atsyãwo, atsyã siwo le dɔ wɔm, kple kplɔ̃ ƒe tɔtrɔwo menyia dome to kplɔ̃ siwo wotsɔ ƒo ƒui me o.
Be míaxe mɔ ɖe atsyã aɖeke nu be wòagadzo ayi kplɔ̃ siwo wotsɔ ƒo ƒui dzi o la, míezãa ɖevi ƒokpli ( >) tiatia le míaƒe CSS me. Esi wònye be ehiã be míaɖo taɖodzinu na tds kple ths siwo katã le thead, tbody, kple , me tfootta la, míaƒe tiatiawɔnu la adze didi ŋutɔ ne menye eyae o. Abe alesi wòle ene la, míezãa .table > :not(caption) > * > *tiatiawɔla si ƒe dzedzeme to vovo vie tsɔ ɖoa taɖodzinu na tds kple ths katã le .table, gake kplɔ̃ siwo ate ŋu anye nested dometɔ aɖeke o.
De dzesii be ne ètsɔ <tr>s kpe ɖe eŋu abe kplɔ̃ ƒe viwo tẽ ene la, <tr>woaxatsa esiawo ɖe a <tbody>me le gɔmedzedzea me, si ana míaƒe tiatiawɔlawo nawɔ dɔ abe alesi woɖoe ene.
Ŋutilã ƒe wɔwɔme
Kplɔ̃ ƒe ta
Abe alesi wòle le kplɔ̃wo kple kplɔ̃ viviwo gome ene la, zã tɔtrɔ ƒe hatsotsowo .table-lightalo .table-darknàna <thead>s nadze abe ɖe wòle keklẽm alo le ɣie ene.
A <caption>wɔa dɔ abe tanya na kplɔ̃ ene. Ekpena ɖe ezãla siwo si screen reader le ŋu be woake ɖe kplɔ̃ ŋu ahase nusi ŋu wòku ɖo gɔme eye woatso nya me ne wodi be yewoaxlẽe.
Ŋlɔ ezãlawo ƒe ŋkɔwo ɖi
# .
Gbã
Nᴐ anyi didi
Alᴐ
1.
Marko
Otto ƒe nyawo
@mdo dzi
2.
Yakob
Thornton ƒe ŋkɔ
@da ami
3.
Larry Xevi la
@twitter dzi
<tableclass="table table-sm"><caption>List of users</caption><thead>
...
</thead><tbody>
...
</tbody></table>
Àte ŋu atsɔ la <caption>aɖo kplɔ̃a tame hã kple .caption-top.
Ŋlɔ ezãlawo ƒe ŋkɔwo ɖi
# .
Gbã
Nᴐ anyi didi
Alᴐ
1.
Marko
Otto ƒe nyawo
@mdo dzi
2.
Yakob
Thornton ƒe ŋkɔ
@da ami
3.
Larry ye nye esia
Xe la
@twitter dzi
<tableclass="table caption-top"><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>
Kplɔ̃ siwo ɖoa nya ŋu
Tabla siwo ɖoa nya ŋu la wɔnɛ be woate ŋu aʋuʋu kplɔ̃wo le tsia dzi bɔbɔe. Na kplɔ̃ ɖesiaɖe nawɔ dɔ le nukpɔkpɔwo katã dzi to a babla .tablekple .table-responsive. Alo, tia breakpoint si sɔ gbɔ wu si dzi nàto akpɔ kplɔ̃ si ɖoa nya ŋu vaseɖe to .table-responsive{-sm|-md|-lg|-xl|-xxl}.
Tsitrenu ƒe lãɖeɖe/tsoɖeɖe
Tabla siwo ɖoa nya ŋu la zãa overflow-y: hidden, si ɖea nyatakaka ɖesiaɖe si yi ŋgɔ wu kplɔ̃a ƒe akpa siwo le ete alo etame la ɖa. Vevietɔ esia ate ŋu atso nuɖuɖu siwo le fli dzi kple ame bubuwo ƒe dɔwɔnu bubuwo ɖa.
Wowɔa nu ɖe ame ŋu ɣesiaɣi
Le breakpoint ɖesiaɖe dzi la, zãe .table-responsivena kplɔ̃ siwo le ʋuʋum le tsia dzi.
Zãe .table-responsive{-sm|-md|-lg|-xl|-xxl}alesi wòhiãe nàtsɔ awɔ kplɔ̃ siwo ɖoa nya ŋu vaseɖe ɖiɖiɖemeƒe aɖe koŋ. Tso gbagbãƒe ma dzi va ɖo dzi la, kplɔ̃a awɔ nu abe alesi wòle ene eye maʋuʋu le tsia dzi o.
Tabla siawo ateŋu adze abe ɖe wogbã ene vaseɖe esime woƒe ŋuɖoɖo ƒe atsyãwo nawɔ dɔ le nukpɔkpɔ ƒe kekeme tɔxɛ aɖewo dzi.