维基百科:格式手册/表格
![]() | 此条目可参照英语维基百科相应条目来扩充。 (2018年6月30日) |
![]() |
格式手册 |
---|
灰字链接非正式指引,仅供参考 |
此维基百科页目前正依照其他维基百科上的内容进行翻译。 (2024年2月20日) |
表格是以行和列呈现数据或信息的方法。 虽然在维基百科里我们可以用表格来有效地表示不同种类的内容,但只应在适当的时候使用。在一个表格里的信息,有时可以比以散文段落方式或以嵌入列表方式更好。
在编辑时,应避免指示到“条目左侧”或“条目右侧”的表格。由于表格的位置会因手机版本而略有分别,而且对于以其他辅助软件阅读维基百科的使用者来说,这种表示是没有意义的。相反地,每个表格应以标题来让使用者去识别。
格式
[编辑]It is recommended that Help:使用维基标记式语言增修表格/1 be used in place of HTML元素s, as they are easier to customize and maintain. A standard "wikitable style" is also available, by adding class="wikitable"
to the top row of the table. The powerful and useful Help:表格 feature can be enabled by adding class="sortable"
to the top row. Extreme caution should be applied if rowspan or colspan is used. It is also possible to combine class, as in class="wikitable sortable"
.
上标与栏位标
[编辑]Table captions and column/row headings should be succinct and self-explanatory. In most cases, individual words or sentence fragments should be used, and 冠词s (a, an, the) are unnecessary. Only the first word in the caption or heading should be capitalized (except for proper nouns), in keeping with Wikipedia's conventions for capital letters. In some rare cases, judicious use of soft hyphens may be helpful; see MOS:HYPHEN for details.
外观
[编辑]In general, styles for tables and other block-level elements should be set using CSS classes, not with inline style attributes. This is because the site-wide CSS is more carefully tested to ensure compatibility with a wide range of browsers; it also creates a greater degree of professionalism by ensuring a consistent appearance between articles. Deviations from standard conventions are acceptable where they create a semantic distinction (for instance, the infoboxes and navigational templates relating to 辛普森一家 use a yellow color-scheme instead of the customary mauve, to tie in with the dominant color in the series) but should not be used gratuitously.
See WP:Deviations and Wikipedia talk:Consensus/RfC for guidance on use of coloring or non-standard formatting, and for when MoS and WikiProjects guidance is at variance.
Consideration may be given to collapsing tables which Wikipedia:格式手册.
Wikipedia tables are set flush-left, and allowed to grow rightward, not centered on the page.
亲和力
[编辑]Screen readers and other web browsing tools make use of specific table tags to help users navigate the data contained within tables. Use the correct wikitable pipe syntax to take advantage of all the features available.
See Wikipedia:格式手册/亲和力 for information about restrained use of color in tables, to avoid creating accessibility problems for visually-impaired as well as normal vision readers.
Do not separate items by leaving blank lines between them, even when using unordered or definition lists. The Wikipedia list templates explicitly identify lists for readers, rather than relying on visual formatting to indirectly imply the presence of a list.
大小
[编辑]Splitting lists and tables per summary style is Wikipedia:条目长度. Among other problems, arbitrarily splitting a wikitable effectively disables the powerful and useful sorting feature from working across the entire table.
On the other hand, overloading tables with too much detailed statistical data is against policy. Careful thought should be given to how a reader would use a table, and what level of detail is appropriate.
适用性
[编辑]适当使用
[编辑]Tables are a way of presenting links, data, or information in rows and columns. They are a complex form of list, formatted into a systematic grid pattern. Tables might be useful for presenting mathematical data such as multiplication tables, comparative figures, or sporting results. They may also be useful for presenting equivalent words in two or more languages; for awards by type and year; complex discographies; etc.
The sortability of multiple columns in a table is a powerful tool that helps the reader to understand relationships and find patterns in large lists. The sortability of tables makes them very useful for "List of..." articles in Wikipedia, which are intended to give an overview of the subject area, and to allow easy comparisons among many similar items. Avoid cramming too much detailed information into individual table entries; if appropriate, the reader should be able to click a Wikilink to read a full, detailed article corresponding to a concise table entry.
Often a list is best left as a list. Before reformatting a list into table form, consider whether the information will be more clearly conveyed by virtue of having rows and columns. If so, then a table is probably a good choice. If there is no obvious benefit to having rows and columns, then a table is probably not the best choice.
Tables should not be misused to resolve visual layout problems. If the information you are editing is not tabular in nature, it probably does not belong in a table: Do not misuse tables for putting a caption under a photograph, arranging a group of links, or other strictly visual features. These practices make the article harder for other Wikipedians to edit, and is likely to cause problems when viewed on different display sizes and aspect ratios. Also, when compared with tables, wikimarkup is more flexible, easier to use, and less arcane when used correctly for desktop publishing layout, page elements, and page orientation and positioning.
Examples:
标准多栏排序表格
[编辑]赛事结果
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
标准多栏表格含副栏位
[编辑]音乐作品
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
混用排序多栏表格
[编辑]电影作品
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
多栏定序表格
[编辑]奖项
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
多栏定序表格数字靠右
[编辑]数学表格
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
树状图(分支图)左侧起始
[编辑]进化分枝图
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Flow data
|
---|
![]() |
不当使用
[编辑]简单条列
[编辑]如果表格内容很简单,最好使用维基标准条列格式以取代表格。条列格式比表格更容易维护,通常也比较容易阅读。
以下是一个条列范例,其格式为:
* 1980: Ultra Wave * 1988: What's Bootsy Doin'? * 1994: Blasters of the Universe * 1994: Fresh Outta 'P' Uni
这样会显示为:
- 1980: Ultra Wave
- 1988: What's Bootsy Doin'?
- 1994: Blasters of the Universe
- 1994: Fresh Outta 'P' Uni
若使用表格格式:
{| class="wikitable" |1980 |Ultra Wave |- |1988 |What's Bootsy Doin'? |- |1994 |Blasters of the Universe |- |1994 |Fresh Outta 'P' Uni |}
其显示为:
1980 | Ultra Wave |
1988 | What's Bootsy Doin'? |
1994 | Blasters of the Universe |
1994 | Fresh Outta 'P' Uni |
散文体
[编辑]Prose is preferred in articles as prose allows the presentation of detail and clarification of context, in a way that a table may not. Prose flows, like one person speaking to another, and is best suited to articles, because their purpose is to explain. Tables which are mainly Wikipedia:格式手册/链接, which are most useful for browsing subject areas, should usually have their own entries: see Wikipedia:独立列表 for detail. In an article, significant items should normally be mentioned naturally within the text rather than merely tabulated.
页面布局
[编辑]Page layouts (using multiple columns, positioning elements, adding borders, etc.) should be done via 层叠样式表, not tables, whenever possible.
- Images and other embedded media should be positioned using standard image syntax.
- There are several templates available that will create preformatted multi-column layouts: see Help:Columns.
- Other elements can be positioned or given special formatting through the use of the HTML
Span与div
element and Help:层叠样式表.
参见
[编辑]- 关于表格的语法,参见帮助:表格
- Help:使用维基标记式语言增修表格/1, quick guide
- Help:Collapsing (show/hide button)
- Wikipedia:Conditional tables
- Wikipedia:Table namespace, an inactive proposal
- HTML元素
参考资料
[编辑]- ^ 1.0 1.1 1.2 1.3 1.4 Turner, Chris. World Professional Championship. cajt.pwp.blueyonder.co.uk. Chris Turner's Snooker Archive. [18 March 2011].
- ^ 2.0 2.1 Turner, Chris. International Open Goya, Matchroom Trophy. cajt.pwp.blueyonder.co.uk. Chris Turner's Snooker Archive. [18 March 2011].
- ^ Turner, Chris. Classic. cajt.pwp.blueyonder.co.uk. Chris Turner's Snooker Archive. [18 March 2011].
- ^ 4.0 4.1 Turner, Chris. UK Championship. cajt.pwp.blueyonder.co.uk. Chris Turner's Snooker Archive. [18 March 2011].
- ^ Top Albums/CDs – Volume 58, No. 25. RPM (加拿大国家图书馆暨档案馆). January 10, 1994 [August 15, 2010].
- ^ IFPI Platinum Europe Awards: 2002 Awards. 国际唱片业协会. [August 15, 2010].
|