Simple Table with Striped Rows
nav_first.pngFirst: code-block:4
2Tables(2,(1))-text,image-border, fixwidth
Edited: 14 Aug 2013 23:14 by: Peter-ZA
Comments: 1
Tags: image table warning-message
nav_prev.pngPrevious: code-block:5
Simple Table with Striped Rows
Edited: 24 Nov 2013 10:54 by: Helmut_pdorf
Comments: 0
Tags: !done table
Last: code-block:3
Table(3,3)-border(1,1,1)-background
Edited: 14 Aug 2013 13:24 by: Helmut_pdorf
Comments: 0
Tags: table
nav_last.png
Next: code-block:1
Table(3,3)-border(0,0,1)-background
Edited: 14 Aug 2013 13:24 by: Helmut_pdorf
Comments: 0
Tags: table
nav_next.png

Example

Copy the following simple table code to your page and add or delete rows and columns as necesssary:

||~ Heading ||~ Heading ||~ Heading ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||

The result will be a table with alternate colored (striped) rows:

Heading Heading Heading
cell content cell content cell content
cell content cell content cell content
cell content cell content cell content
cell content cell content cell content
cell content cell content cell content
cell content cell content cell content

Code

[[module css]]
table.wiki-content-table {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
}

table.wiki-content-table th {
    background-color: #666;
    border: 1px solid #888888;
    color: #fff;
    padding: 0.3em 0.7em;
    text-align: left;
}

table.wiki-content-table tr {
    background-color: #FFFFFF;
    border: 1px solid darkgray;
}

table.wiki-content-table tr:nth-child(2n+1) {
    background-color: #EEEEEE;
}

table.wiki-content-table td {
    border: medium none;
    color: #666666;
    font-size: 85%;
    padding: 0.3em 0.7em;
    text-align: left;
}
[[/module]]

Copy the following simple table code to your page and add or delete rows and columns as necesssary:

[[code]]
||~ Heading ||~ Heading ||~ Heading ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
[[/code]]

The result will be a table with  alternate colored (striped) rows:

||~ Heading ||~ Heading ||~ Heading ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||
|| cell content || cell content || cell content ||

Use as Include File

To use the above INCL file, please include the following line into your code:

[[include :incl:code-block:5]]



Comments

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License