Help:Introduction to tables with Wiki Markup/Old advanced formatting page
Introduction to tables Editing tables Expanding tables Summary
|
how to add HTML comments Comments can be added by using the HTML
The comment doesn't do anything, but can be helpful to explain how tables work.
how to add HTML attributes to cell content The following text: {| class="wikitable" |+ Caption title |- ! header1 ! header2 ! header3 |- | row1cell1 | row1cell2 | row1cell3 |- | row2cell1 | row2cell2 | row2cell3 |} Would produce this table:
When constructing advanced tables, we may wish to add HTML attributes to cell contents and captions. This is actually very easy. Cells hold content, e.g. So HTML attributes can be inserted like this: | HTML | row1cell1 | HTML | row1cell2 | HTML | row1cell3 Or like this: Adding to the header can be done like this: ! HTML | header1 ! HTML | header2 ! HTML | header3 Or like this: Adding to the caption is done like this: For example, lets say we wanted to make some cell backgrounds yellow colored. The HTML attribute to do so is {| class="wikitable" |+ Caption: some cells yellow. |- ! header1 ! header2 ! header3 |- | style="background: yellow" | row1cell1 | row1cell2 | style="background: yellow" | row1cell3 |- | row2cell1 | style="background: yellow" | row2cell2 | row2cell3 |} Then it would produce this:
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.
how to add HTML attributes to tables and rows Tables and rows use the following markup: HTML attributes can be added to the table markup like this: HTML attributes can be added to the row markup like this: For example, to turn a table's content yellow, the following text could be used: {| class="wikitable" style="background: yellow" |+ Caption: yellow contents. |- ! header1 ! header2 ! header3 |- | row1cell1 | row1cell2 | row1cell3 |- | row2cell1 | row2cell2 | row2cell3 |} In this example, two HTML attributes (class and style) are applied to the table. The result would be:
For more details, see: Help:Table; |