Help:Tables/ar

From MediaWiki.org
Jump to: navigation, search
PD عند تعديلك لقالب، سترى المعاملات أو المعطيات (parameters) بالترتيب المتوقع والصحيح. إذا كان هناك معامل أو معطى يجب إضافته سترى مكانه نجمه (*).
PD

الجداول may be authored in wiki pages using either XHTML table elements directly, or using wikicode formatting to define the table. XHTML table elements and their use are well described on various web pages and will not be discussed here. The benefit of wikicode is that the table is constructed of character symbols which tend to make it easier to perceive the table structure in the article editing view compared to XHTML table elements.

As a general rule, it is best to avoid using a table unless you need one. Table markup often complicates page editing.

ملخص كود الويكى للجدول[edit | edit source]

{|
بداية الجدول
|+
عنوان الجدول، اختيارى; فقط بين بداية الجدول، و ألصف الأول فى الجدول
|-
صف جديد, اختيارى فى الصف الأول -- wiki engine assumes the first row
! 
عنوان العمود , اختيارى. يمكن إضافة عناوين العواميد على نفس سطر باستخدام علامة (!!) للفصل بينهم أو تبدأ عنوان جديد فى سطر جديد بينهم خط عمودى واحد (!) فقط
|
محتوى خلية الجدول , خلية مطلوبة! أيضا يمكن إضافة خليات الجدول فى نفس السطر بإستخدام (||) أو تبدأ خلية جديدة فى سطر جدبد باستخدام (|) فقط
|}
نهاية الجدول
  • The above marks must start on a new line except the double || and !! for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
  • XHTML attributes. Each mark, except table end, optionally accepts one or more XHTML attributes. Attributes must be on the same line as the mark. Separate attributes from each other with a single space.
    • Cells and caption (| or ||, ! or !!, and |+) hold content. So separate any attributes from content with a single pipe (|). Cell content may follow on same line or on following lines.
    • Table and row marks ({| and |-) do not directly hold content. Do not add pipe (|) after their optional attributes. If you erroneously add a pipe after attributes for the table mark or row mark the parser will delete it and your final attribute if it was touching the erroneous pipe!
  • Content may (a) follow its cell mark on the same line after any optional XHTML attributes or (b) on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
  • Escaping to insert a pipe (|) character into a table use the <nowiki> markup

أساسيات[edit | edit source]

The following table lacks borders and good spacing but shows the simplest wiki markup table structure.

تكتب ترى
{|
|Orange
|Apple
|-
|Bread
|Pie
|-
|Butter
|Ice cream 
|}
Orange Apple
Bread Pie
Butter Ice cream

The cells in the same row can be listed on one line separated by ||.

Extra spaces within cells in the wiki markup, as in the wiki markup below, do not affect the actual table rendering.

تكتب ترى
{|
|  Orange    ||   Apple   ||   more
|-
|   Bread    ||   Pie     ||   more
|-
|   Butter   || Ice cream ||  and more
|}
Orange Apple more
Bread Pie more
Butter Ice cream and more

عناوين العواميد[edit | edit source]

Table headers can be created by using "!" instead of "|". Headers usually show up bold and centered by default.

تكتب ترى
{|
! Item
! Amount
! Cost
|-
|Orange
|10
|7.00
|-
|Bread
|4
|3.00
|-
|Butter
|1
|5.00
|-
!Total
|
|15.00
|}
Item Amount Cost
Orange 10 7.00
Bread 4 3.00
Butter 1 5.00
Total 15.00

عنوان الجدول[edit | edit source]

A table caption can be added to the top of any table as follows.

تكتب You get
{|
|+Food complements
|-
|Orange
|Apple
|-
|Bread
|Pie
|-
|Butter
|Ice cream 
|}
Food complements
Orange Apple
Bread Pie
Butter Ice cream

XHTML attributes[edit | edit source]

You can add XHTML attributes to tables. For the authoriative source on these, see the W3C's HTML 4.01 Specification page on tables.

Attributes on tables[edit | edit source]

Placing attributes after the table start tag ({|) applies attributes to the entire table.

تكتب You get
{| border="1"
|Orange
|Apple
|12,333.00
|-
|Bread
|Pie
|500.00
|-
|Butter
|Ice cream
|1.00
|}
Orange Apple 12,333.00
Bread Pie 500.00
Butter Ice cream 1.00

Attributes on cells[edit | edit source]

You can put attributes on individual cells. For example, numbers may look better aligned right.

تكتب You get
{| border="1"
|Orange
|Apple
|align="right" | 12,333.00
|-
|Bread
|Pie
|align="right" | 500.00
|-
|Butter
|Ice cream
|align="right" | 1.00
|}
Orange Apple 12,333.00
Bread Pie 500.00
Butter Ice cream 1.00

You can also use cell attributes when you are listing multiple cells on a single line. Note that the cells are separated by ||, and within each cell the attribute(s) and value are separated by |.

You type You get
{| border="1"
| Orange || Apple     || align="right" | 12,333.00
|-
| Bread  || Pie       || align="right" | 500.00
|-
| Butter || Ice cream || align="right" | 1.00
|}
Orange Apple 12,333.00
Bread Pie 500.00
Butter Ice cream 1.00

Attributes on rows[edit | edit source]

You can put attributes on individual rows, too.

You type You get
{| border="1"
|Orange
|Apple
|align="right"|12,333.00
|-
|Bread
|Pie
|align="right"|500.00
|- style="font-style:italic; color:green;"
|Butter
|Ice cream
|align="right"|1.00
|}
Orange Apple 12,333.00
Bread Pie 500.00
Butter Ice cream 1.00

HTML colspan and rowspan[edit | edit source]

You can use HTML colspan and rowspan attributes on cells for advanced layout.

You type You get
{| border="1"
!colspan="6"|Shopping List
|-
|rowspan="2"|Bread & Butter
|Pie
|Buns
|Danish
|colspan="2"|Croissant
|-
|Cheese
|colspan="2"|Ice cream
|Butter
|Yoghurt
|}
Shopping List
Bread & Butter Pie Buns Danish Croissant
Cheese Ice cream Butter Yoghurt

With HTML attributes and CSS styles[edit | edit source]

CSS style attributes can be added with or without other HTML attributes.

You type You get
{| style="color:green; background-color:#ffffcc;" cellpadding="20" cellspacing="0" border="1"
|Orange
|Apple
|-
|Bread
|Pie
|-
|Butter
|Ice cream 
|}
Orange Apple
Bread Pie
Butter Ice cream

Attributes can be added to the caption and headers as follows.

You type You get
{| border="1" cellpadding="20" cellspacing="0"
|+ align="bottom" style="color:#e76700;" |''Food complements''
|-
|Orange
|Apple
|-
|Bread
|Pie
|-
|Butter
|Ice cream 
|}
Food complements
Orange Apple
Bread Pie
Butter Ice cream

Caveats[edit | edit source]

Negative numbers[edit | edit source]

If you start a cell on a new line with a negative number with a minus sign (or a parameter that evaluates to a negative number), your table can get broken, because the characters |- will be parsed as the wiki markup for table row, not table cell. To avoid this, insert a space before the value (| -6) or use in-line cell markup (|| -6).

CSS vs Attributes[edit | edit source]

Table borders specified through CSS rather than the border attribute will render incorrectly in a small subset of text browsers.

:اللغة English  • العربية • català • Deutsch • Zazaki • español • suomi • français • Bahasa Indonesia • italiano • 日本語 • 한국어 • português • português do Brasil • română • русский • slovenčina • Tiếng Việt • 中文