Faʻamaumauga ma faʻataʻitaʻiga mo le filifilia o le siiina o laulau (tuʻuina atu lo latou faʻaogaina masani i JavaScript plugins) ma Bootstrap.
I luga o lenei itulau
Vaaiga lautele
Ona o le lautele o le faʻaogaina o <table>elemene i luga o widget vaega lona tolu e pei o kalena ma tagata e piki aso, o laulau a Bootstrap e filifili i totonu . Fa'aopoopo le vasega fa'avae .tablei so'o se <table>, ona fa'alautele lea ma a matou vasega fa'aopoopo e filifili po'o sitaili masani. O sitaili laulau uma e le o tu'ufa'atasia i Bootstrap, o lona uiga o so'o se laulau fa'amomoli e mafai ona fa'ailoga tuto'atasi mai le matua.
I le faʻaaogaina o le faʻailoga pito sili ona taua, o le faʻaogaina lea o .tablelaulau faʻavae i Bootstrap.
#
Tulaga tasi
Mulimuli
Uu
1
Mareko
Otto
@mdo
2
Iakopo
Thornton
@ga'o
3
Larry le Manu
@twitter
<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>
Eseesega
Fa'aoga vasega fa'apitoa e valivali ai laulau, laina laulau po'o sela ta'itasi.
Vasega
Ulutala
Ulutala
Fa'atonu
sela
sela
Peraimeri
sela
sela
Lua
sela
sela
Manuia
sela
sela
Mata'utia
sela
sela
Lapataiga
sela
sela
Fa'amatalaga
sela
sela
Malamalama
sela
sela
Pogisa
sela
sela
<!-- 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>
Tu'uina atu le uiga i tekinolosi fesoasoani
O le fa'aogaina o le lanu e fa'aopoopo ai le uiga e na'o se fa'aaliga va'aia, e le fa'ailoa atu i tagata fa'aoga o tekonolosi fesoasoani - e pei o le au faitau mata. Ia fa'amautinoa o fa'amatalaga o lo'o fa'ailogaina i le lanu e manino mai le anotusi lava ia (fa'ata'ita'iga o tusitusiga va'aia), pe fa'aofi mai i isi auala, e pei o tusitusiga fa'aopoopo natia i le .visually-hiddenvasega.
Laupapa fa'amamafa
laina laina
Fa'aoga .table-stripede fa'aopoopo ai le zebra-striping i so'o se laina laulau i totonu o le <tbody>.
#
Tulaga tasi
Mulimuli
Uu
1
Mareko
Otto
@mdo
2
Iakopo
Thornton
@ga'o
3
Larry le Manu
@twitter
<tableclass="table table-striped"> ...
</table>
Koluma talatala
Fa'aoga .table-striped-columnse fa'aopoopo ai le zebra-striping i so'o se koluma laulau.
Matou te amata i le setiina o le tua o se laulau laulau ma le --bs-table-bgmeatotino masani. O suiga uma o le laulau ona fa'atulaga lea o mea fa'ale-aganu'u e valivali ai sela laulau. I lenei auala, tatou te le oʻo i faʻalavelave pe a faʻaogaina lanu semi-manino e fai ma faʻasologa o laulau.
Ona matou faʻaopopoina lea o se atigi pusa faʻapipiʻi i luga o sela laulau ma box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);faʻapipiʻi i luga o soʻo se mea faʻapitoa background-color. Talu ai matou te faʻaaogaina se faʻasalalauga tele ma leai se faʻafefe, o le lanu o le a monotone. Talu ai --bs-table-accent-bgua le setiina e ala i le faaletonu, e leai sa matou ata lafoia o pusa.
A fa'aopoopo le .table-striped, .table-striped-columns, .table-hoverpo'o .table-activevasega, --bs-table-accent-bge tu'u le lanu i se lanu e fa'amanino e valivali ai le tua.
Mo suiga laulau ta'itasi, matou te fa'atupuina se --bs-table-accent-bglanu e maualuga le fa'atusatusaga e fa'atatau i lena lanu. Mo se fa'ata'ita'iga, o le si'i lanu mo .table-primarye sili atu le pogisa ae .table-darke mama le lanu si'i.
O tusitusiga ma lanu tuaoi e gaosia i le auala lava e tasi, ma o latou lanu e tuufaasolo ona o le faaletonu.
Faaopoopo i ai se tuaoi mafiafia, pogisa i le va o vaega laulau— <thead>, <tbody>, ma le <tfoot>—i .table-group-dividerle . Fa'asinomaga le lanu e ala i le suia o le border-top-color(lea matou te le o tuuina atu nei se vasega aoga mo le taimi nei).
#
Tulaga tasi
Mulimuli
Uu
1
Mareko
Otto
@mdo
2
Iakopo
Thornton
@ga'o
3
Larry le Manu
@twitter
html
<tableclass="table"><thead><tr><thscope="col">#</th><thscope="col">First</th><thscope="col">Last</th><thscope="col">Handle</th></tr></thead><tbodyclass="table-group-divider"><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>
Fa'aoga tu'usa'o
O sela o laulau o <thead>lo'o fa'aoga sa'o i le pito i lalo. O sela laulau i totonu e <tbody>maua mai lo latou fa'aogaina mai <table>ma fa'aogatotonu i le pito i luga ona o le faaletonu. Fa'aoga vasega fa'aoga sa'o e toe fa'aoga i mea e mana'omia.
Ulutala 1
Ulutala 2
Ulutala 3
Ulutala 4
O lenei sela e maua vertical-align: middle;mai le laulau
O lenei sela e maua vertical-align: middle;mai le laulau
O lenei sela e maua vertical-align: middle;mai le laulau
O nisi nei o tusitusiga o lo'o tu'u i luga, ua fa'amoemoe e fa'aoga ai sina avanoa tu'usa'o, e fa'aalia ai pe fa'afefea ona fa'aoga le fa'aoga sa'o i sela na muamua atu.
O lenei sela e maua vertical-align: bottom;mai le laina laulau
O lenei sela e maua vertical-align: bottom;mai le laina laulau
O lenei sela e maua vertical-align: bottom;mai le laina laulau
O nisi nei o tusitusiga o lo'o tu'u i luga, ua fa'amoemoe e fa'aoga ai sina avanoa tu'usa'o, e fa'aalia ai pe fa'afefea ona fa'aoga le fa'aoga sa'o i sela na muamua atu.
O lenei sela e maua vertical-align: middle;mai le laulau
O lenei sela e maua vertical-align: middle;mai le laulau
O lenei sela e fa'aoga i le pito i luga.
O nisi nei o tusitusiga o lo'o tu'u i luga, ua fa'amoemoe e fa'aoga ai sina avanoa tu'usa'o, e fa'aalia ai pe fa'afefea ona fa'aoga le fa'aoga sa'o i sela na muamua atu.
<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>
Faamoega
Sitaili tuaoi, sitaili malosi, ma suiga laulau e le tuufaasolo mai i laulau faamoega.
Ina ia puipuia soʻo se sitaili mai le tafe i luga o laulau faʻapipiʻi, matou te faʻaogaina le child combinator ( >) filifili i la matou CSS. Talu ai e tatau ona tatou tulimata'i uma tds ma ths i totonu o le thead, tbody, ma le tfoot, e foliga umi la tatou filifiliga e aunoa ma lea. E pei o lea, matou te fa'aogaina le filifiliga e foliga ese .table > :not(caption) > * > *e fa'atatau i tds ma ths uma o le .table, ae leai se tasi o so'o se laulau fa'apena.
Manatua afai e te faʻaopoopoina <tr>le s e pei o tamaiti tuusaʻo o se laulau, <tr>o le a afifiina i latou i se mea <tbody>e le mafai, ma faʻapea e faʻaoga a matou tagata filifilia e pei ona faʻamoemoeina.
Anatomy
Ulu laulau
E pei o laulau ma laulau pogisa, fa'aoga vasega fa'aliliu .table-lightpo'o .table-darkle <thead>fa'aalia o le malamalama po'o le efuefu pogisa.
O se <caption>galuega e pei o se ulutala mo se laulau. E fesoasoani i tagata fa'aoga i lau faitau mata e su'e se laulau ma malamalama i lona uiga ma filifili pe latou te fia faitau i ai.
Lisi o tagata fa'aoga
#
Tulaga tasi
Mulimuli
Uu
1
Mareko
Otto
@mdo
2
Iakopo
Thornton
@ga'o
3
Larry le Manu
@twitter
<tableclass="table table-sm"><caption>List of users</caption><thead> ...
</thead><tbody> ...
</tbody></table>
E mafai foi ona e tuu le <caption>pito i luga ole laulau ma .caption-top.
Lisi o tagata fa'aoga
#
Tulaga tasi
Mulimuli
Uu
1
Mareko
Otto
@mdo
2
Iakopo
Thornton
@ga'o
3
Larry
le Manu
@twitter
html
<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>
laulau tali
O laulau tali e fa'ataga ai le ta'ai fa'alava ma faigofie. Fai so'o se laulau e tali atu i va'aiga uma e ala i le afifiina o .tablele .table-responsive. Po'o, filifili se pito maualuga e mafai ona i ai se laulau tali atu e ala i le fa'aogaina o le .table-responsive{-sm|-md|-lg|-xl|-xxl}.
Tu'u sa'o/tapuina
O laulau talitali e fa'aoga ai le overflow-y: hidden, lea e tipi ese ai so'o se mea e alu i tua atu o pito pito i lalo po'o pito i luga ole laulau. Aemaise lava, e mafai e lenei mea ona tipi ese menus pa'ū ma isi widgets isi vaega.
Talitonu i taimi uma
I luga o so'o se mea malolo, fa'aoga .table-responsivemo laulau fa'ata'amilo fa'alava.
Fa'aoga .table-responsive{-sm|-md|-lg|-xl|-xxl}pe a mana'omia e fai ai laulau fa'afofoga e o'o atu i se vaega fa'apitoa. Mai lena vaeluaga ma luga, o le laulau o le a amio masani ae le taʻavale faalava.
O nei laulau e ono foliga malepe se'ia o latou sitaili tali mai e fa'aoga i le lautele o va'aiga fa'apitoa.
Ole fa'ailoga ( $table-striped-bg-factor, $table-active-bg-factor& $table-hover-bg-factor) o lo'o fa'aaogaina e iloa ai le fa'atusatusaga o suiga ole laulau.
E ese mai le lanu malamalama ma le pogisa o laulau, o lanu autu e faʻamalamalamaina e le $table-bg-scalefesuiaiga.