Dokumentasi dan contoh untuk gaya opt-in tabel (mengingat penggunaannya yang lazim dalam plugin JavaScript) dengan Bootstrap
Contoh
Karena meluasnya penggunaan tabel di seluruh widget pihak ketiga seperti kalender dan pemilih tanggal, kami merancang tabel kami untuk diikutsertakan. Cukup tambahkan kelas dasar # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _6 ke , then extend with custom styles or our various included modifier classes. apa pun
Using the most basic table markup, here’s how ________0_______6-based tables look in Bootstrap. All table styles are inherited in Bootstrap 4, meaning any nested tables will be styled in the same manner as the parent.
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larrythe Bird@twitter# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _8#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larrythe Bird@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
Opsi kepala meja
Mirip dengan tabel dan tabel gelap, gunakan kelas pengubah # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 9 atau # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 0 untuk membuat s tampak abu-abu terang atau gelap
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larrythe Bird@twitter#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larrythe Bird@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _
Baris bergaris
Gunakan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _1 untuk menambahkan garis-garis zebra ke baris tabel mana pun di dalam
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larrythe Bird@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larrythe Bird@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
Meja bertepi
Tambahkan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _2 untuk batas di semua sisi tabel dan sel
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larry si Burung@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larry si Burung@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
Baris yang dapat digantung
Tambahkan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _3 untuk mengaktifkan status hover pada baris tabel dalam a
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larry si Burung@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larry si Burung@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
Meja kecil
Tambahkan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _4 untuk membuat tabel lebih kompak dengan memotong padding sel menjadi dua
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larry si Burung@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larry si Burung@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter
Kelas kontekstual
Gunakan kelas kontekstual untuk mewarnai baris tabel atau sel individual
ClassHeadingHeadingActiveCellCellDefaultCellCellPrimaryCellCellSecondaryCellCellSuccessCellCellDangerCellCellWarningCellCellInfoCellCellLightCellCellDarkCellCell
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _1Varian latar belakang tabel reguler tidak tersedia dengan tabel gelap, namun, Anda dapat menggunakan utilitas teks atau latar belakang untuk mendapatkan gaya serupa
#HeadingHeading1CellCell2CellCell3CellCell4CellCell5CellCell6CellCell7CellCell8CellCell9CellCell
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _2Menyampaikan makna pada teknologi bantu
Menggunakan warna untuk menambah makna hanya memberikan indikasi visual, yang tidak akan disampaikan kepada pengguna teknologi pendukung – seperti pembaca layar. Pastikan bahwa informasi yang dilambangkan dengan warna terlihat jelas dari konten itu sendiri (mis. g. teks yang terlihat), atau disertakan melalui cara alternatif, seperti teks tambahan yang disembunyikan dengan kelas # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 5
Buat tabel responsif dengan membungkus # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 6 apa pun dengan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 7, membuat tabel bergulir secara horizontal di setiap breakpoint # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 8 hingga (namun tidak termasuk) masing-masing 576px, 768px, 992px, dan 1120px
Perhatikan bahwa karena browser saat ini tidak mendukung , kami mengatasi batasan dan area pandang dengan lebar pecahan (yang dapat terjadi dalam kondisi tertentu pada perangkat dpi tinggi, misalnya) dengan menggunakan nilai dengan presisi lebih tinggi untuk perbandingan ini
Teks
Fungsi seperti heading untuk tabel. Ini membantu pengguna dengan pembaca layar untuk menemukan tabel dan memahami tentang apa dan memutuskan apakah mereka ingin membacanya
Daftar pengguna#FirstLastHandle1MarkOtto@mdo2JacobThornton@fat3Larrythe Bird@twitter
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _3
Tabel responsif
Tabel responsif memungkinkan tabel digulir secara horizontal dengan mudah. Jadikan tabel apa pun responsif di semua viewport dengan membungkus # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 6 dengan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 2. Atau, pilih breakpoint maksimum yang dapat digunakan untuk membuat tabel responsif menggunakan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter 7
Tabel responsif menggunakan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _4, yang memotong konten apa pun yang melampaui tepi bawah atau atas tabel. Secara khusus, ini dapat memotong menu dropdown dan widget pihak ketiga lainnya
Selalu responsif
Di setiap breakpoint, gunakan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _2 untuk menggulir tabel secara horizontal
#HeadingHeadingHeadingHeadingHeadingHeadingHeadingHeadingHeading1CellCellCellCellCellCellCellCellCell2CellCellCellCellCellCellCellCellCell3CellCellCellCellCellCellCellCellCell
# First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _4Spesifik titik henti
Gunakan # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter _7 seperlunya untuk membuat tabel responsif hingga breakpoint tertentu. Dari breakpoint tersebut ke atas, tabel akan berperilaku normal dan tidak menggulir secara horizontal