Sebuah '''tabel''' adalah susunan baris dan kolom yang digunakan untuk mengatur dan menempatkan data. Perangkat lunak MediaWiki yang digunakan oleh Wikipedia menyediakan fasilitas pembuatan tabel dengan dua cara: sintaks HTML dan sintaks tabel-wiki (sintaks tabel-wiki lebih dianjurkan). Tabel dapat dikustomisasi dengan berbagai gaya dan reka. Dianjurkan memakai daftar berkolom sebagai pertimbangan.
<!--{{dablink|Untuk pengenalan dasar-dasarnya, lihat [[Bantuan:Tabel/Pengenalan tabel|Pengenalan tabel]].}}-->
Sebuah '''[[Tabel (informasi)|tabel]]''' adalah susunan baris dan kolom yang digunakan untuk mengatur dan menempatkan data. Perangkat lunak [[MediaWiki]] yang digunakan oleh [[Wikipedia]] menyediakan fasilitas pembuatan tabel dengan dua cara: sintaks [[HTML]] dan sintaks tabel-wiki (sintaks tabel-wiki lebih dianjurkan). Tabel dapat dikustomisasi dengan berbagai gaya dan reka. Dianjurkan memakai [[Bantuan:Daftar|daftar berkolom]] sebagai pertimbangan.
== Menggunakan toolbar ==
Klik atau (Tabel) pada bilah alat penyunting untuk menambahkan tabel secara otomatis. Jika tombol "Tabel" belum ada pada bilah alat penyunting, ikuti panduan ini untuk menambahkannya.
[[File:Advanced toolbar of vector skin.png|frame|center|Bilah alat vektor – default]]
[[File:Toolbar2.PNG|frame|center|Bilah alat monobook]]
Klik [[File:Vector toolbar insert table button.png]] atau [[File:Button insert table.png]] (Tabel) pada [[Bantuan:Bilah alat penyunting|bilah alat penyunting]] untuk menambahkan tabel secara otomatis. Jika tombol "Tabel" belum ada pada bilah alat penyunting, ikuti [[mw:Customizing edit toolbar|panduan ini]] untuk menambahkannya.
Setelah diklik, akan muncul jendela "Masukkan tabel". Jika Anda langsung mengeklik tombol "Masukkan" pada jendela itu, akan muncul teks berikut ini:
<pre style="display: inline-block;">
{| class="wikitable"
|-
! Teks judul !! Teks judul !! Teks judul
|-
| Teks sel || Teks sel || Teks sel
|-
| Teks sel || Teks sel || Teks sel
|-
| Teks sel || Teks sel || Teks sel
|}
</pre>
Kode tersebut akan menghasilkan tabel berikut:
{| class="wikitable"
|-
! Teks judul !! Teks judul !! Teks judul
|-
| Teks sel || Teks sel || Teks sel
|-
| Teks sel || Teks sel || Teks sel
|-
| Teks sel || Teks sel || Teks sel
|}
Teks yang disediakan ("Teks judul" dan "Teks sel") diganti dengan data yang ingin ditaruh pada tabel.
Setiap jenis elemen di atas harus berada pada baris sendiri. Untuk penyederhanaan, kolom data maupun judul kolom dapat digabungkan menjadi satu baris dengan memberikan markah '''<nowiki>!!</nowiki>''' atau '''<nowiki>||</nowiki>'''.
Parameter tabel yang dapat digunakan pada tabel-wiki sama dengan HTML ([http://www.w3.org/TR/html401/struct/tables.html#edef-TABLE]) dan diberikan setelah markah yang sesuai.
* Parameter untuk tabel secara keseluruhan, diberikan setelah '''<nowiki>{|</nowiki>'''.<br />Contoh: <nowiki>{| cellpadding="2" width="100%"</nowiki>.
* Parameter untuk baris, diberikan setelah '''<nowiki>|-</nowiki>'''.<br />Contoh: <nowiki>|- valign="top"</nowiki>.
* Parameter untuk judul kolom atau kolom data diberikan setelah '''!''' atau '''|''' dan dibatasi dengan isi kolom dengan '''|'''.<br />Contoh: <nowiki>| align="center" | Isi data</nowiki>.
<!--
== Basic table markup summary ==
{{See also|Help:Basic table markup}}
{| class="wikitable" style="width:100%"
| style="padding: 10px;"| <big><nowiki>{|</nowiki></big>
! style="padding: 5px;"|
Table start
| ''Required''.
|-
| style="padding: 10px;"| <big><nowiki>|+</nowiki></big>
! style="padding: 5px;" |
Table caption
| ''Optional''.
Only between table start and first table row.
|-
| style="padding: 10px;"| <big><nowiki>|-</nowiki></big>
! style="padding: 5px;" |
Table row
| ''Optional''.
Can be omitted before the first row and/or after the last row.
|-
| style="padding: 10px;"| <big><nowiki>!</nowiki></big>
! style="padding: 5px;" |
Table header cell
| ''Optional''.
Consecutive table header cells may be added on same line separated by double marks (<code>!!</code>); or start on new lines, each with its own single mark (<code>!</code>).
|-
| style="padding: 10px;"| <big><nowiki>|</nowiki></big>
! style="padding: 5px;" |
Table data cell
| ''Optional''.
Consecutive table data cells may be added on same line separated by double marks (<code><nowiki>||</nowiki></code>) or start on new lines, each with its own single mark (<code><nowiki>|</nowiki></code>). This mark is also used to separate [[HTML attribute]]s from cell and caption contents.
|-
| style="padding: 10px;"| <big><nowiki>|}</nowiki></big>
! style="padding: 5px;" |
Table end
| ''Required''.
|}
*The above marks must ''start on a new line'', except the double marks (<code>||</code> and <code>!!</code>) for optionally adding consecutive cells to a single line.
*''Blank spaces'' at the beginning of a line are ignored.
*''Content'' may either follow its cell mark on the same line (after any optional HTML attributes); or on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as with lists, headings, or nested tables, must be on its own new line.
*To insert a ''pipe character'' (<code>|</code>) into a table caption or cell, use the <code><nowiki>|</nowiki></code> escaping markup.
-->
== Contoh ==
=== Tabel sederhana ===
<pre>
{|
|+ Daftar presiden Indonesia
|-
! No
! Nama
! Dari
! Sampai
|-
| 1
| Soekarno
| 1945
| 1967
|-
| 2
| Soeharto
| 1967
| 1998
|}
</pre>
Akan menghasilkan tampilan:
{|
|+ Daftar presiden Indonesia
|-
! No
! Nama
! Dari
! Sampai
|-
| 1
| Soekarno
| 1945
| 1967
|-
| 2
| Soeharto
| 1967
| 1998
|}
=== Penggabungan kolom ===
<pre>
{|
|+ Daftar presiden Indonesia
|-
! No !! Nama !! Dari !! Sampai
|-
| 1 || Soekarno || 1945 || 1967
|-
| 2 || Soeharto || 1967 || 1998
|}
</pre>
Akan memberikan hasil yang sama dengan contoh sebelumnya.
=== Parameter ===
<pre>
{| cellpadding="2" cellspacing="1"
|- bgcolor="lightgrey"
! align="center" | No !! bgcolor="#ff0" | Nama !! Dari !! Sampai
|-
| align="right" | 1 || Soekarno || 1945 || 1967
|-
| align="right" | 2 || Soeharto || 1967 || style="color: red;" | 1998
|}
</pre>
Akan menghasilkan tabel:
{| cellpadding="2" cellspacing="1"
|- bgcolor="lightgrey"
! align="center" | No !! bgcolor="#ff0" | Nama !! Dari !! Sampai
|-
| align="right" | 1 || Soekarno || 1945 || 1967
|-
| align="right" | 2 || Soeharto || 1967 || style="color: red;" | 1998
|}
=== Warna ===
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"><pre><nowiki/blockquote>
{|
| style="background:red; color:white" | abc
| def
| bgcolor="red" | <span style="color:white"> ghi </span>
| jkl
|}
</nowiki></pre></blockquote>
Akan menghasilkan tabel:
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"></blockquote>
{|
| style="background:red; color:white" | abc
| def
| bgcolor="red" | <span style="color:white"> ghi </span>
| jkl
|}
</blockquote>
'''Catatan:''' Kode untuk "<code>bgcolor</code>" dapat dilihat di [http://www.w3.org/TR/html4/present/graphics.html#h-15.1.1 situs W3 bagian ''deprecated''].
Sebagaimana parameter lain, warna dapat ditentukan untuk seluruh baris atau seluruh tabel; parameter untuk baris lebih diutamakan daripada nilai untuk seluruh tabel, dan parameter untuk sel lebih utama daripada untuk baris:
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"><pre><nowiki/blockquote>
{| style="background:yellow; color:green"
|-
| abc || def || ghi
|- style="background:red; color:white"
| jkl || mno || pqr
|-
| stu || style="background:silver" | vwx || yz
|}
</nowiki></pre></blockquote>
Akan menghasilkan tabel:
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"></blockquote>
{| style="background:yellow; color:green"
|-
| abc || def || ghi
|- style="background:red; color:white"
| jkl || mno || pqr
|-
| stu || style="background:silver" | vwx || yz
|}
</blockquote>
== Prettytable ==
''Class'' prettytable adalah sebuah ''tableclass'' yang didefinisikan di Wikipedia. Dengan memakai class ini, tabel akan ditambahkan garis horisontal dan vertikal serta warna latar belakang abu-abu.
{| cellpadding="4" cellspacing="4"
||Standar||Hasil||Dengan Prettytable||Hasil
|-
|valign="top"|
<pre>
{|
|-
!No.
!Keterangan
|-
||1.||Satu
|-
||2.||Dua
|-
||3.||Tiga
|-
||4.||Empat
|-
||5.||Lima
|-
||6.||Enam
|}
</pre>
|valign="top"|
{|
|-
!No.
!Keterangan
|-
||1.||Satu
|-
||2.||Dua
|-
||3.||Tiga
|-
||4.||Empat
|-
||5.||Lima
|-
||6.||Enam
|}
|valign="top"|
<pre>
{| class=prettytable
|-
!No.
!Keterangan
|-
||1.||Satu
|-
||2.||Dua
|-
||3.||Tiga
|-
||4.||Empat
|-
||5.||Lima
|-
||6.||Enam
|}
</pre>
|valign="top"|
{| class="prettytable"
|-
!No.
!Keterangan
|-
||1.||Satu
|-
||2.||Dua
|-
||3.||Tiga
|-
||4.||Empat
|-
||5.||Lima
|-
||6.||Enam
|}
|}
Untuk class "tabelcantik" sebagai pengembangan dari "prettytable", lihat [[:Bantuan:Tabelcantik]]. Class "tabelcantik" secara otomatis menambahkan warna selang-seling pada setiap pergantian baris.
== Lihat pula ==
* [[Bantuan:Halaman multikolom]]
* [[Bantuan:Memperbaiki pranala sunting yang bertumpuk]]
* [[m:Help:Table]]
* [[Bantuan:Tabelcantik]]
== Pranala luar ==
* {{en}} [http://area23.brightbyte.de/csv2wp.php csv2wp, konvertor CSV ke tabel wiki]
* {{en}} [http://www.cnic.org/html2mediawiki.html Konvertor tabel HTML ke tabel wiki di cnic.org]
* {{en}} [http://www.wackyboy.com/ConvertHtmlTableToWikiTable.html Konvertor tabel HTML ke tabel wiki di wackyboy.com]
* {{en}} [http://www.uni-bonn.de/~manfear/html2wiki-tables.php Konvertor tabel HTML ke tabel wiki di uni-bonn.de]
* {{en}} [http://diberri.dyndns.org/html2wiki.html Konvertor tabel HTML ke tabel wiki di diberri.dyndns.org]
* {{de}} [[:de:Wikipedia:Helferlein/EXCEL Tabellenumwandlung|VBA-Macro untuk EXCEL tableconversion]]
{{bantuan-stub}}
[[Kategori:Bantuan|Tabel]]
|