Table Test
From The Space Library
This is a demonstration of a sortable table. The small buttons next to the word Header can be clicked and the columns sorted.
Header 1 | Header 2 | Header 3 |
---|---|---|
First row 1 cell 1 | First row 1 cell 2 | First row 1 cell 3 |
Second row 2 cell 1 | Second row 2 cell 2 | Second row 2 cell 3 |
Third row 3 cell 1 | Third row 3 cell 2 | Third row 3 cell 3 |
To reproduce this table on your page, copy and paste the code seen below into your page.
You can change the words Header 1, Header 2 and Header 3 to whatever suits your requirements. Then put the text into the rows and cells by replacing where it says First row 1 cell 1 etc
{| class="wikitable sortable" ! style="background:#d0e5f5" | Header 1 ! style="background:#d0e5f5" | Header 2 ! style="background:#d0e5f5" | Header 3 |-valign="top" | First row 1 cell 1|| First row 1 cell 2 || First row 1 cell 3 |- | Second row 2 cell 1|| Second row 2 cell 2 || Second row 2 cell 3 |- | Third row 3 cell 1|| Third row 3 cell 2 || Third row 3 cell 3 |}
Add rows and columns by repeating the sequence like this:
{| class="wikitable sortable" ! style="background:#d0e5f5" | Header 1 ! style="background:#d0e5f5" | Header 2 ! style="background:#d0e5f5" | Header 3 ! style="background:#d0e5f5" | Header 4 |-valign="top" | First row 1 cell 1|| First row 1 cell 2 || First row 1 cell 3|| First row 1 cell 4 |- | Second row 2 cell 1|| Second row 2 cell 2 || Second row 2 cell 3|| Second row 2 cell 4 |- | Third row 3 cell 1|| Third row 3 cell 2 || Third row 3 cell 3 || Third row 3 cell 4 |- | Fourth row 3 cell 1|| Fourth row 3 cell 2 || Fourth row 3 cell 3 || Fourth row 3 cell 3 |}
Header 1 | Header 2 | Header 3 | Header 4 |
---|---|---|---|
First row 1 cell 1 | First row 1 cell 2 | First row 1 cell 3 | First row 1 cell 4 |
Second row 2 cell 1 | Second row 2 cell 2 | Second row 2 cell 3 | Second row 2 cell 4 |
Third row 3 cell 1 | Third row 3 cell 2 | Third row 3 cell 3 | Third row 3 cell 4 |
Fourth row 3 cell 1 | Fourth row 3 cell 2 | Fourth row 3 cell 3 | Fourth row 3 cell 3 |