赛派号

爱普生投影仪cbx05评测 Help:Introduction to tables with Wiki Markup/All

Help:Table Wikitext Intro Editing Expanding Summary VisualEditor Intro Editing Adding Expanding Summary Basics Creation Locations Widths Advanced Sortable Formatting Collapsing Conditional History Category Templates MOS Accessibility Tutorial This help page is a how-to guide.It explains concepts or processes used by the Wikipedia community. It is not one of Wikipedia's policies or guidelines, and may reflect varying levels of consensus.ShortcutsWP:TABLEBWP:TABLEBWP:TABLEBEGINWP:TABLEBEGINWP:TABLESTARTWP:TABLESTART ShortcutHelp:WikitableHelp:Wikitable Enhanced editing toolbar with table button highlighted

Tables are a common way of displaying data. This tutorial provides a guide to making new tables and editing existing ones. For guidelines on when and how to use tables, see the Manual of Style.

The easiest way to insert a new table is to use the editing toolbar that appears when you edit a page (see image above). Clicking the button will open a dialog where you define what you want in your new table. Once you've chosen the number of rows and columns, the wiki markup text for the table is inserted into the article. Then you can replace the "Example" text with the data you want to be displayed.

Tables in Wikipedia, particularly large ones, can look intimidating to edit, but the way they work is simple.

Components of tables

Whether you've just inserted a new table, or are editing an existing one, changing the text in the table cells determines what the table looks like to a reader. But you can do more than just change text.

A table consists of the following basic elements, all of which you can modify:

{| start Besides beginning the table, this is also where the table's class is defined – for example, class="wikitable". A table's "class" applies standard Wikipedia formatting to that table. The two most commonly used classes are "wikitable" and "wikitable sortable"; the latter allows the reader to sort the table by clicking on the header cell of any column. |+ caption Required for accessibility purposes on data tables, and placed only between the table start and the first table row. ! header cell Optional. Each header cell starts with a new line and a single exclamation mark (!), or several header cells can be placed consecutively on the same line, separated by double exclamation marks (!!). |- new row To begin a new row of cells, use a single vertical bar (|) and a hyphen (-). | new cellin row To add a new cell in a row, start each new cell with a new line and a single vertical bar (|), or several cells can be placed consecutively on the same line, separated by double vertical bars (||). |} end To end the table, use a single vertical bar (|) and a left facing curly brace (}) alone on a new line.

Blank spaces at the beginning and end of a cell are ignored.

Layout

When you edit an existing table, you'll probably see one of two common ways that the table is laid out:

Data is arranged like a table

This is useful when there aren't too many columns and the cell contents are short (e.g. just numbers). This is the markup layout that the button will create.

{| class="wikitable" |+ Caption |- ! Header C1 !! Header C2 !! Header C3 |- | R1C1 || R1C2 || R1C3 |- | R2C1 || R2C2 || R2C3 |} Cells are arranged vertically

With lots of columns, or cells with long contents, putting each cell on a new line can improve readability of the markup.

{| class="wikitable" |+ Caption |- ! Header C1 ! Header C2 ! Header C3 |- | R1C1 | R1C2 | R1C3 |- | R2C1 | R2C2 | R2C3 |}

To a reader, both of the above examples will look the same:

Caption Header C1 Header C2 Header C3 R1C1 R1C2 R1C3 R2C1 R2C2 R2C3

Expanding tables

It is common to want to edit an existing table by adding just one extra column or row of information.

Adding a row

To add an extra row into a table, you'll need to insert an extra row break and the same number of new cells as are in the other rows.

The easiest way to do this in practice, is to duplicate an existing row by copying and pasting the markup. It's then just a matter of editing the cell contents. Make sure that you preserve the end of table markup, |}, below the last row of the table.

Adding a column

To add an extra column to a table, you'll need to add a single extra cell in the same position to each row.

Preview your changes

Previewing your edits is especially important for tables; it is easy to make a minor error that breaks table formatting.

See also Help:Table: the main table help page Help:HTML in wikitext#Tables Introduction Starting introduction Policies and Guidelines Source editor Editing Referencing Images Tables VisualEditor Editing Referencing Images Tables Talk pages Nigating Manual of Style Conclusion

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lsinopec@gmail.com举报,一经查实,本站将立刻删除。

上一篇 没有了

下一篇没有了