As I’ve started using Markdown more, I’m wishing the table syntax were cleaner. I once used a wiki (I wish I could remember which one) that had this syntax:
| Date | Description |
| 12.21.09 | Finished transcribing the November documents |
Which produced a table that looked like this:
| Date | Description |
|---|---|
| 12.21.09 | Finished transcribing the November documents |
Super simple. It assumes that if you have more than one row, your first row is a header row. Compare that to the HTML I’d have to write instead:
<table>
<thead>
<tr>
<th>Date</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>12.21.09</td>
<td>Finished transcribing the November documents</td>
</tr>
</tbody>
</table>
Sure, you couldn’t do much more than this with it — no control over alignment, no possibility for complex setups — but it was enough. Being easy to write goes a long way. (And again, if you need more control, you can always revert to HTML.)
Now look at PHP Markdown Extra’s syntax:
Date | Description
-------- | -----------
12.21.09 | Finished transcribing the November documents
Or MediaWiki’s (Wikipedia):
{|
|Date
|Description
-
|12.21.09
|Finished transcribing the November documents
|}
Ew. Both are a pain to write and MediaWiki’s is ugly to boot.
My philosophy: if I want to write a complex table, then I’ll use HTML. Most of the time I don’t, however, and I want something simple, fast, and beautiful, like the syntax up at the top.
I found a Python-Markdown extension, Simple Tables, which uses a variant on the syntax above, but it seems to have been replaced by PHP Markdown Extra, which uses the yucky syntax.
Anybody know of any Markdown extensions (preferably PHP, since that’s what my WordPress blog is running on) that do nice tables like this?
Throw in your two cents