| 75 | == How to use `#!td` and other table related processors == #Tables |
| 76 | |
| 77 | `#!td` or `#!th` processors are actually the main ones, for creating table data and header cells, respectively. The other processors `#!table` and `#!tr` are not required for introducing a table structure, as `#!td` and `#!th` will do this automatically. The `|-` row separator can be used to start a new row when needed, but some may prefer to use a `#!tr` block for that, as this introduces a more formal grouping and offers the possibility to use an extra level of indentation. The main purpose of the `#!table` and `#!tr` is to give the possibility to specify HTML attributes, like ''style'' or ''valign'' to these elements. |
| 78 | |
| 79 | ||= Wiki Markup =||= Display =|| |
| 80 | {{{#!td |
| 81 | {{{ |
| 82 | Simple 2x2 table with rich content: |
| 83 | {{{#!th align=left |
| 84 | - Left |
| 85 | - Header |
| 86 | }}} |
| 87 | {{{#!th align=left |
| 88 | - Right |
| 89 | - Header |
| 90 | }}} |
| 91 | |---------------------------------- |
| 92 | {{{#!td style="background: #ffd" |
| 93 | - Left |
| 94 | - Content |
| 95 | }}} |
| 96 | {{{#!td style="vertical-align: top" |
| 97 | !RightContent |
| 98 | }}} |
| 99 | |---------------------------------- |
| 100 | || ... and this can be mixed||\ |
| 101 | ||with pipe-based cells || |
| 102 | {{{#!td colspan=2 |
| 103 | Pick the style the more appropriate |
| 104 | to your content |
| 105 | |
| 106 | See WikiFormatting#Tables for details |
| 107 | on the pipe-based table syntax. |
| 108 | }}} |
| 109 | |
| 110 | If one needs to add some |
| 111 | attributes to the table itself... |
| 112 | |
| 113 | {{{#!table style="border: none; text-align: center" |
| 114 | {{{#!tr ==================================== |
| 115 | {{{#!th style="border: none" |
| 116 | Left header |
| 117 | }}} |
| 118 | {{{#!th style="border: none" |
| 119 | Right header |
| 120 | }}} |
| 121 | }}} |
| 122 | {{{#!tr ==== style="border: 1px dotted grey" |
| 123 | {{{#!td style="border: none" |
| 124 | 1.1 |
| 125 | }}} |
| 126 | {{{#!td style="border: none" |
| 127 | 1.2 |
| 128 | }}} |
| 129 | }}} |
| 130 | {{{#!tr ==================================== |
| 131 | {{{#!td style="border: none" |
| 132 | 2.1 |
| 133 | }}} |
| 134 | {{{#!td |
| 135 | 2.2 |
| 136 | }}} |
| 137 | }}} |
| 138 | }}} |
| 139 | |
| 140 | |
| 141 | }}} |
| 142 | }}} |
| 143 | {{{#!td valign=top |
| 144 | Simple 2x2 table with rich content: |
| 145 | {{{#!th align=left |
| 146 | - Left |
| 147 | - Header |
| 148 | }}} |
| 149 | {{{#!th align=left |
| 150 | - Right |
| 151 | - Header |
| 152 | }}} |
| 153 | |---------------------------------- |
| 154 | {{{#!td style="background: #ffd" |
| 155 | - Left |
| 156 | - Content |
| 157 | }}} |
| 158 | {{{#!td style="vertical-align: top" |
| 159 | !RightContent |
| 160 | }}} |
| 161 | |---------------------------------- |
| 162 | || ... and this can be mixed||\ |
| 163 | ||with pipe-based cells || |
| 164 | {{{#!td colspan=2 |
| 165 | Pick the style the more appropriate |
| 166 | to your content |
| 167 | |
| 168 | See WikiFormatting#Tables for details |
| 169 | on the pipe-based table syntax. |
| 170 | }}} |
| 171 | |
| 172 | If one needs to add some |
| 173 | attributes to the table itself... |
| 174 | |
| 175 | {{{#!table style="border: none; text-align: center" |
| 176 | {{{#!tr ==================================== |
| 177 | {{{#!th style="border: none" |
| 178 | Left header |
| 179 | }}} |
| 180 | {{{#!th style="border: none" |
| 181 | Right header |
| 182 | }}} |
| 183 | }}} |
| 184 | {{{#!tr ==== style="border: 1px dotted grey" |
| 185 | {{{#!td style="border: none" |
| 186 | 1.1 |
| 187 | }}} |
| 188 | {{{#!td style="border: none" |
| 189 | 1.2 |
| 190 | }}} |
| 191 | }}} |
| 192 | {{{#!tr ==================================== |
| 193 | {{{#!td style="border: none" |
| 194 | 2.1 |
| 195 | }}} |
| 196 | {{{#!td |
| 197 | 2.2 |
| 198 | }}} |
| 199 | }}} |
| 200 | }}} |
| 201 | }}} |
| 202 | |