User:Mrjulesd/sandbox/3: Difference between revisions
Appearance
< User:Mrjulesd | sandbox
Content deleted Content added
attribute=value |
Wikipedia copyright and sharing |
||
Line 1: | Line 1: | ||
{{navbox |
|||
| name = Wikipedia copyright and sharing |
|||
| title = Wikipedia copyright and sharing |
|||
| bodyclass = hlist |
|||
| state = {{{state<includeonly>|{{{1|autocollapse}}}</includeonly>}}} |
|||
|group1=Policy |
|||
|list1= |
|||
* [[Wikipedia:Copyrights|Copyright policy]] |
|||
** [[Wikipedia talk:Copyrights|Policy discussion]] |
|||
* [[Wikipedia:Copyright violations|Copyright violation policy]] |
|||
* [[Wikipedia:Reusing Wikipedia content|Reusing Wikipedia content]] |
|||
* [[Wikipedia:Image use policy|Image use policy]] |
|||
** [[Wikipedia:Logos|Logos]] |
|||
** [[Wikipedia:WikiProject Comics/copyright|Comics copyright]] |
|||
** [[Wikipedia:Copyright on emblems|Copyright on emblems]] |
|||
** [[Wikipedia:News agencies and fair use|News agencies and fair use]] |
|||
|group2=Licences |
|||
==Introduction== |
|||
|list2= |
|||
The markup for a basic table is: |
|||
* [[Wikipedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License|Text of CC BY-SA 3.0 Unported]] |
|||
<pre style="width:50%"> |
|||
** [[Wikipedia:Text of Creative Commons Attribution-ShareAlike 4.0 International License|Text of CC BY-SA 4.0 International]] |
|||
{| class="wikitable" |
|||
* [[Wikipedia:Text of the GNU Free Documentation License|Text of the GFDL]] |
|||
|+ Caption: example table |
|||
** [[Wikipedia:Text of the GNU Free Documentation License, version 1.2|Text of the GFDL, version 1.2]] |
|||
|- |
|||
** [[Wikipedia:GFDL upgrade|GFDL upgrade]] |
|||
! header1 |
|||
** [[Wikipedia:What the GFDL is not|What the GFDL is not]] |
|||
! header2 |
|||
* [[Wikipedia:Image license migration|Image license migration]] |
|||
! header3 |
|||
* [[Wikipedia:Licensing update|Licensing update]] |
|||
|- |
|||
| row1cell1 |
|||
| row1cell2 |
|||
| row1cell3 |
|||
|- |
|||
| row2cell1 |
|||
| row2cell2 |
|||
| row2cell3 |
|||
|} |
|||
</pre> |
|||
|group3=Guidelines |
|||
This would produce: |
|||
|list3= |
|||
* [[Wikipedia:Public domain|Public domain content]] |
|||
{| class="wikitable" |
|||
* [[Wikipedia:Non-free content|Non-free content]] |
|||
|+ Caption: example table |
|||
** [[Wikipedia:Non-free content criteria|Non-free content criteria]] |
|||
|- |
|||
** [[Wikipedia:Removal of non-free images|Removal of non-free images]] |
|||
! header1 |
|||
* [[Wikipedia:Non-U.S. copyrights|Non-U.S. copyrights]] |
|||
! header2 |
|||
* [[Wikipedia:Copying within Wikipedia|Copying within Wikipedia]] |
|||
! header3 |
|||
* [[Wikipedia:Plagiarism|Plagiarism]] |
|||
|- |
|||
* [[Wikipedia:Public domain|Public domain]] |
|||
| row1cell1 |
|||
** [[Wikipedia:Granting work into the public domain|Granting work into the public domain]] |
|||
| row1cell2 |
|||
| row1cell3 |
|||
|- |
|||
| row2cell1 |
|||
| row2cell2 |
|||
| row2cell3 |
|||
|} |
|||
<code>{|</code> opens a table, and <code>|}</code> closes it. <code>class="wikitable"</code> is used with a lot of tables on Wikipedia, and adds some standard formatting, and follows on the same line as <code>{|</code>. |
|||
|group4=Processes |
|||
<code>|+ Caption: example table</code> adds the caption "Caption: example table" to the top of the table. The caption is optional. |
|||
|list4= |
|||
* [[Wikipedia:Copyright problems|Copyright problems]] |
|||
Columns headers are created by <code>! column name</code>. Cells are created by <code>| cell text</code>. The divider between rows is <code>|-</code>. You can add an extra column by just sticking <code>! new column name</code> at the end of the last column name. To fill the cells in that column, you need to add another cell to each row: fill it by typing <code>| cell text</code>. If you want to add an extra row, just add <code>|-</code> to the table, and fill it with however many cells are appropriate. |
|||
** [[Wikipedia:Copyright problems/Advice for admins|Advice for admins]] |
|||
** [[Wikipedia:Copyright problems/Advice for clerks|Advice for clerks]] |
|||
* [[Wikipedia:Suspected copyright violations|Suspected copyright violations]] |
|||
** [[Wikipedia:Spotting possible copyright violations|Spotting possible copyright violations]] |
|||
* [[Wikipedia:Files for discussion|Files for discussion]] |
|||
* [[Wikipedia:Contributor copyright investigations|Contributor copyright investigations]] |
|||
* [[Wikipedia:Media copyright questions|Media copyright questions]] |
|||
|group5=Resources |
|||
Blank spaces at the beginning of a line are ignored. Thus <code>|row1cell1</code> and <code>| row1cell1</code> are identical. |
|||
|list5= |
|||
* [[Wikipedia:Designated agent|Designated agent for claimed infringement]] |
|||
To add a pipe (<code>|</code>) character into cell contents, you need to use the {{xtag|nowiki}} markup. |
|||
* [[Wikipedia:Basic copyright issues|Basic copyright issues]] |
|||
* [[Wikipedia:Text Copyright Violations 101|Text Copyright Violations 101]] |
|||
* [[Wikipedia:FAQ/Copyright|Frequently asked questions]] |
|||
* [[Wikipedia:Copyright assistance|Copyright assistance]] |
|||
* [[Wikipedia:File copyright tags|File copyright tags]] |
|||
** [[Wikipedia:File copyright tags/All|All]] |
|||
** [[Wikipedia:File copyright tags/Comprehensive|Comprehensive]] |
|||
** [[Wikipedia:GFDL standardization|GFDL standardization]] |
|||
* [[Public domain|Meaning of public domain]] |
|||
* [[Fair use|Meaning of fair use]] |
|||
* [[Wikipedia:WikiProject Copyright Cleanup|WikiProject Copyright Cleanup]] |
|||
* [[Wikipedia:Copying text from other sources|Copying text from other sources]] |
|||
* [[Wikipedia:Copyright in lists|Copyright in lists]] |
|||
* [[Wikipedia:Provenance|Provenance]] |
|||
* [[Wikipedia:Restricted materials|Restricted materials]] |
|||
* [[Wikipedia:Video links|Video links]] |
|||
* [[:Category:Wikipedia copyright|Copyright category]] |
|||
To recap, the markup is as follow. All this markup must start on a new line, except for double marks. |
|||
|group6=Forking<br/>and mirrors |
|||
{| class="wikitable" |
|||
|list6= |
|||
| |
|||
<nowiki />{| |
|||
| '''Table start:''' ''it is required.'' |
|||
|- |
|||
| |
|||
<nowiki />|+ |
|||
| '''Table caption:''' ''it is optional.'' Only between '''table start''' and '''first table row''' |
|||
|- |
|||
| |
|||
<nowiki />! |
|||
| '''Table header cell:''' ''it is optional.'' Cells may start on new lines, each beginning with its own single mark. Cell contents may also be put on the next line. |
|||
|- |
|||
| |
|||
<nowiki />!! |
|||
| '''Consecutive table header cell:''' ''it is optional.'' Cells may be added on same lines separated by double marks. |
|||
|- |
|||
| |
|||
<nowiki />|- |
|||
| '''Table row''': ''it is optional on the first row, but otherwise required''. The wiki engine assumes the first row. |
|||
|- |
|||
| |
|||
<nowiki />| |
|||
| '''Table data cell''': ''it is required for data cells on new lines.'' Cells may start on new lines, each beginning with its own single mark. Cell contents may also be put on the next line. It is also used to separate HTML attributes from cell contents (both data or header), or caption contents. |
|||
|- |
|||
| |
|||
<nowiki />|| |
|||
| '''Consecutive table data cell''': ''it is required for data cells on the same line.'' Cells may be added on same lines separated by double marks. |
|||
|- |
|||
| |
|||
<nowiki />|} |
|||
| '''Table end:''' ''it is required.'' |
|||
|} |
|||
* [[Wikipedia:Content forking|Content forking]] |
|||
==Using double marks with tables== |
|||
* [[Wikipedia:FAQ/Forking|Forking FAQ]] |
|||
* [[Wikipedia:Mirrors and forks|Mirrors and forks]] |
|||
** [[Wikipedia:Mirrors and forks/All|All]] |
|||
** [[Wikipedia:Mirrors and forks/Baidu Baike|Baidu Baike]] |
|||
* [[Wikipedia:Buying Wikipedia articles in print or another form|Buying Wikipedia articles in print or another form]] |
|||
* [[Wikipedia:Republishers|Republishers]] |
|||
* [[Wikipedia:CC BY-SA Compliance|CC BY-SA Compliance]] |
|||
* [[Wikipedia:GFDL Compliance|GFDL Compliance]] |
|||
* [[Wikipedia:Standard CC-BY-SA violation letter|Standard CC-BY-SA violation letter]] |
|||
* [[Wikipedia:Standard license violation letter|Standard license violation letter]] |
|||
|group7=Sharing |
|||
The above markup must start on a new line. This includes the cell markup (<code>|</code> and <code>!</code>). But the double cell markup (<code>||</code> and <code>!!</code>) can optionally be used for adding consecutive cells to a single line. |
|||
|list7= |
|||
* [[Wikipedia:Donating copyrighted materials|Donating copyrighted material]] |
|||
For example, this would produce the same table as above: |
|||
* [[Wikipedia:Requesting copyright permission|Requesting copyright permission]] |
|||
** [[Wikipedia:Example requests for permission|Example requests for permission]] |
|||
** [[Wikipedia:Declaration of consent for all enquiries|Declaration of consent for all enquiries]] |
|||
* [[Wikipedia:Finding images tutorial|Finding images tutorial]] |
|||
* [[Wikipedia:The Wikipedia Library|The Wikipedia Library]] |
|||
** [[Template:TWLJ|TWL journals]] |
|||
* [[Wikipedia:WikiProject Resource Exchange/Shared Resources|WikiProject Resource Exchange Shared Resources]] |
|||
** [[Wikipedia:WikiProject Resource Exchange/Resource Request|Resource Request]] |
|||
** [[Wikipedia:WikiProject Maps/Source materials|Maps]] |
|||
* [[Wikipedia:GNU Free Documentation License resources|GFDL resources]] |
|||
* [[Wikipedia:Free image resources|Free image resources]] |
|||
* [[Wikipedia:List of free online resources|Free online resources]] |
|||
* [[Wikipedia:Free sound resources|Free sound resources]] |
|||
* [[Wikipedia:Public domain resources|Public domain resources]] |
|||
* [[Wikipedia:Public domain image resources|Public domain image resources]] |
|||
* [[Wikipedia:Free or semi-free non-Public-Domain information resources|Non-PD resources]] |
|||
* [[Wikipedia:List of bibliographies|Bibliographies]] |
|||
<pre style="width:60%"> |
|||
{| class="wikitable" |
|||
|+ Caption: example table |
|||
|- |
|||
! header1 !! header2 !! header3 |
|||
|- |
|||
| row1cell1 || row1cell2 || row1cell3 |
|||
|- |
|||
| row2cell1 || row2cell2 || row2cell3 |
|||
|} |
|||
</pre> |
|||
}} |
|||
==HTML attributes== |
|||
<noinclude> |
|||
{{documentation | content = |
|||
==Usage== |
|||
[[HTML attribute]]s are often needed to be added to tables for various reasons. HTML attributes take the basic form: |
|||
==Collapsible option== |
|||
<code>Attribute="value"</code> |
|||
{{collapsible option}} |
|||
Multiple attributes can be applied by repeating this, for example <code>Attribute1="value1" Attribute2="value2" </code> |
|||
Commonly included attributes in tables: |
|||
*<code>class</code> attribute, for example <code>class="wikitable"</code>. The class attribute is normally applied to a complete table. |
|||
*<code>style</code> attribute, for example <code>style="background: yellow"</code>. It is used for ''CSS'' ([[Cascading Style Sheets]]) styling, and can be applied to whole tables, table captions, table rows and individual cells. |
|||
*<code>rowspan</code> attribute, for example <code>rowspan="2"</code>. Used for formatting cells so they extend beyond their normal extent of one row. |
|||
*<code>colspan</code> attribute, for example <code>colspan="2"</code>. Used for formatting cells so they extend beyond their normal extent of one column. |
|||
*<code>border</code> attributes, for example <code>border="1"</code>. Used for applying a borders to whole tables, but not needed if using <code>class="wikitable"</code>. |
|||
Other attributes are used with tables, for example <code>scope</code>, but might not be supported by [[HTML5]]. See [http://www.w3schools.com/tags/tag_table.asp table at w3schools.com] and [http://www.w3schools.com/tags/tag_td.asp td at w3schools.com] for some examples. |
|||
===HTML attribute summary=== |
|||
* All table markup, except table end (<code>|}</code>), optionally accepts one or more HTML attributes on the same line. |
|||
* Cell markup (<code>|</code>, <code>||</code>, <code>!</code>, <code>!!</code>) and caption markup (<code>|+</code>) hold content. So separate any attributes from content with a single pipe (<code>|</code>), even when cell content is on a new line, which is permissible. |
|||
*''Cell content'' may follow on the same line after its ''cell markup'' (which may include HTML attributes); or on lines below the cell markup. Cell content that uses its own markup may need to start on a new line; this can happen with things like lists, headings, or nested tables. |
|||
* Table and row markup (<code>{|</code> and <code>|-</code>) do not directly hold content. Therefore, do ''not'' add a pipe (<code>|</code>) after any HTML attributes. |
|||
===Adding HTML attributes to cells and captions=== |
|||
This is how to cell contents, including header cell contents, and also captions. |
|||
Cells hold content, e.g. <code>row1cell1</code>. The markup for cells and captions are: <code>|</code>, <code>||</code>, <code>!</code>, <code>!!</code> and <code>|+</code>. HTML attributes need to be kept separate from cell content or captions with a single pipe (<code>|</code>). Cell content or captions may follow on the same line, or on a following line. |
|||
So HTML attributes can be inserted like this: |
|||
<pre style="width:30%"> |
|||
| Attribute="value" | row1cell1 |
|||
| Attribute="value" | row1cell2 |
|||
| Attribute="value" | row1cell3 |
|||
</pre> |
|||
Where <code>Attribute="value"</code> indicates one or more HTML attribute, for example <code>style="background: yellow"</code>. |
|||
If the cells are onthe same line, HTML attributes can be added like this: <code>| Attribute="value" | row1cell1 || Attribute="value" | row1cell2 || Attribute="value" | row1cell3 </code> |
|||
Adding to the ''header'' can be done like this: |
|||
<pre style="width:30%"> |
|||
! Attribute="value" | header1 |
|||
! Attribute="value" | header2 |
|||
! Attribute="value" | header3 |
|||
</pre> |
|||
Or like this: <code>! Attribute="value" | header1 !! Attribute="value" | header2 !! Attribute="value" | header3 </code> |
|||
Adding to the ''caption'' is done like this: <code> |+ Attribute="value" | Caption Title </code> |
|||
For example, lets say we wanted to make some cell backgrounds yellow colored. The HTML attribute to do so is <code>style="background: yellow"</code>. It could be added to some cells in a table like this: |
|||
<pre style="width:70%"> |
|||
{| class="wikitable" |
|||
|+ Caption: some cells yellow. |
|||
|- |
|||
! header1 |
|||
! header2 |
|||
! header3 |
|||
|- |
|||
| style="background: yellow" | row1cell1 |
|||
| row1cell2 |
|||
| style="background: yellow" | row1cell3 |
|||
|- |
|||
| row2cell1 |
|||
| style="background: yellow" | row2cell2 |
|||
| row2cell3 |
|||
|} |
|||
</pre> |
|||
Then it would produce this: |
|||
{| class="wikitable" |
|||
|+ Caption: some cells yellow. |
|||
|- |
|||
! header1 |
|||
! header2 |
|||
! header3 |
|||
|- |
|||
| style="background: yellow" | row1cell1 |
|||
| row1cell2 |
|||
| style="background: yellow" | row1cell3 |
|||
|- |
|||
| row2cell1 |
|||
| style="background: yellow" | row2cell2 |
|||
| row2cell3 |
|||
|} |
|||
As you can see, a yellow background color has been added to some of the cells. Note that, optionally, cell contents could be added to new lines if desired. |
|||
===Cell contents on new lines=== |
|||
The following markup applies a yellow background to three cells: |
|||
<pre style="width:70%"> |
|||
| style="background: yellow" | row1cell1 |
|||
| style="background: yellow" | row1cell2 |
|||
| style="background: yellow" | row1cell3 |
|||
</pre> |
|||
Cell contents can be added to new lines if so desired. So therefore the following markup would have a similar effect to the above: |
|||
<pre style="width:70%"> |
|||
| style="background: yellow" | |
|||
row1cell1 |
|||
| style="background: yellow" | |
|||
row1cell2 |
|||
| style="background: yellow" | |
|||
row1cell3 |
|||
</pre> |
|||
===Adding HTML attributes to whole tables and rows=== |
|||
Tables and rows use the following markup: <code>{|</code>, <code>|-</code> and <code>|}</code>. HTML attributes can be added to <code>{|</code> and <code>|-</code>. They do not directly hold content. Because of this, they should ''not'' have an added pipe (<code>|</code>) after any HTML attributes. |
|||
HTML attributes can be added to the table markup like this: <code>{| Attribute="value"</code>, where <code>Attribute="value"</code> indicates one or more attributes, e.g. <code>class="wikitable"</code>. |
|||
HTML attributes can be added to the row markup like this: <code>|- Attribute="value"</code> |
|||
For example, to turn a table's content yellow, the following text could be used: |
|||
<pre style="width:90%"> |
|||
{| class="wikitable" style="background: yellow" |
|||
|+ Caption: yellow contents. |
|||
|- |
|||
! header1 |
|||
! header2 |
|||
! header3 |
|||
|- |
|||
| row1cell1 |
|||
| row1cell2 |
|||
| row1cell3 |
|||
|- |
|||
| row2cell1 |
|||
| row2cell2 |
|||
| row2cell3 |
|||
|} |
|||
</pre> |
|||
In this example, two HTML attributes (class and style) are applied to the table. The result would be: |
|||
{| class="wikitable" style="background: yellow" |
|||
|+ Caption: yellow contents. |
|||
|- |
|||
! header1 |
|||
! header2 |
|||
! header3 |
|||
|- |
|||
| row1cell1 |
|||
| row1cell2 |
|||
| row1cell3 |
|||
|- |
|||
| row2cell1 |
|||
| row2cell2 |
|||
| row2cell3 |
|||
|} |
|||
==How tables are formed== |
|||
If you use the following wiki markup for a table: |
|||
<pre style="width:60%"> |
|||
{| class="wikitable" |
|||
|+ Caption: example table |
|||
|- |
|||
! header1 |
|||
! header2 |
|||
! header3 |
|||
|- |
|||
| row1cell1 |
|||
| row1cell2 |
|||
| row1cell3 |
|||
|- |
|||
| row2cell1 |
|||
| row2cell2 |
|||
| row2cell3 |
|||
|} |
|||
</pre> |
|||
The [[MediaWiki]] software translates it into the following [[HTML]]: |
|||
<pre style="width:60%"> |
|||
<table class="wikitable"> |
|||
<caption>Caption: example table</caption> |
|||
<tr> |
|||
<th>header1</th> |
|||
<th>header2</th> |
|||
<th>header3</th> |
|||
</tr> |
|||
<tr> |
|||
<td>row1cell1</td> |
|||
<td>row1cell2</td> |
|||
<td>row1cell3</td> |
|||
</tr> |
|||
<tr> |
|||
<td>row2cell1</td> |
|||
<td>row2cell2</td> |
|||
<td>row2cell3</td> |
|||
</tr> |
|||
</table> |
|||
</pre> |
|||
The <code>table</code> tag opens and closes the table. The <code>caption</code> tag adds a caption. The <code>tr</code> tag opens and closes table rows. The <code>th</code> tag adds a header cell. The <code>td</code> tag adds a data cell. |
|||
Although you can add a table using HTML coding rather than wiki markup, it is discouraged due to readability reasons. |
|||
==See also== |
==See also== |
||
{{Wikipedia editor navigation templates|state=expanded}} |
|||
}} |
|||
For further help with tables, see: [[Help:Table]]; {{Wikibooks-inline|Editing Wikitext/Tables}}; and [[Wikipedia:Advanced table formatting]]. |
|||
[[Category:Wikipedia-internal navigational templates]] |
|||
</noinclude> |
Revision as of 19:20, 8 December 2016
Documentation
Usage
Collapsible option
This template's initial visibility currently defaults to autocollapse
, meaning that if there is another collapsible item on the page (a navbox, sidebar, or table with the collapsible attribute), it is hidden apart from its title bar; if not, it is fully visible.
To change this template's initial visibility, the |state=
parameter may be used:
{{Mrjulesd/sandbox|state=collapsed}}
will show the template collapsed, i.e. hidden apart from its title bar.{{Mrjulesd/sandbox|state=expanded}}
will show the template expanded, i.e. fully visible.