Multimarkdown Tables
You can use Multimarkdown syntax for tables. The following shows a sample:
| Priority apples | Second priority | Third priority |
|-------|--------|---------|
| ambrosia | gala | red delicious |
| pink lady | jazz | macintosh |
| honeycrisp | granny smith | fuji |
Result:
Priority apples | Second priority | Third priority |
---|---|---|
ambrosia | gala | red delicious |
pink lady | jazz | macintosh |
honeycrisp | granny smith | fuji |
<br/><br/>
.HTML Tables
If you need a more sophisticated table syntax, use HTML syntax for the table. Although you’re using HTML, you can use Markdown inside the table cells by adding markdown="1"
as an attribute for the td
tag, as shown in the following table. You can also control the column widths.
<table>
<colgroup>
<col width="30%" />
<col width="70%" />
</colgroup>
<thead>
<tr class="header">
<th align="left">Field</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" markdown="1">First column **fields**</td>
<td align="left" markdown="1">Some descriptive text. This is a markdown link to [Google](http://google.com). Or see [some link][mydoc_tags].</td>
</tr>
<tr>
<td align="left" markdown="1">Second column **fields**</td>
<td align="left" markdown="1">Some more descriptive text. Here we have a Markdown-formatted list:
* first item
* second item
* third item
</td>
</tr>
</tbody>
</table>
Result:
Field | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
First column fields</td> |
Some descriptive text. This is a markdown link to Google. Or see [some link][mydoc_tags].</td> </tr> | ||||||||||||||||||||
Second column fields</td> |
Some more descriptive text. Here we have a Markdown-formatted list:
|
Food | Description | Category | Sample type |
---|---|---|---|
Apples | A small, somewhat round and often red-colored, crispy fruit grown on trees. | Fruit | Fuji |
Bananas | A long and curved, often-yellow, sweet and soft fruit that grows in bunches in tropical climates. | Fruit | Snow |
Kiwis | A small, hairy-skinned sweet fruit with green-colored insides and seeds. | Fruit | Golden |
Oranges | A spherical, orange-colored sweet fruit commonly grown in Florida and California. | Fruit | Navel |
Notice a few features:
- You can keyword search the table. When you type a word, the table filters to match your word.
- You can sort the column order.
- You can page the results so that you show only a certain number of values on the first page and then require users to click next to see more entries.
Read more of the datatable documentation to get a sense of the options you can configure. You should probably only use datatables when you have long, massive tables full of information.