Tables on my experimental PHP Markdown

Michel Fortin michel.fortin at
Thu Oct 21 16:16:10 EDT 2004

I took about 4 hours writing and debugging small regex and surrounding 
code to make a table syntax work. It works!

So if you like, you can test making tables using the PHP Markdown 
Dingus. Choose "MD Experimental" from the format menu.

Here is a one-row-per-line table you can play with:

First Name      Last Name       URL
Jeffrey         Zeldman         <>
John            Gruber          <>
Joshua          Davis           <>

Here is another table using `---` as a row separator:

Company					Description
Apple Computer inc.		The maker of the *Macintosh*, *iPod*,
						*Quicktime* and *Firewire*.
Microsoft				No need for a description.

Paragraphs, and other blocks element are not supported inside a cell.

If you want an empty cell, just leave it empty.

If you want a header just leave a blank line after the `---` or `===` 
"underline". This may need some revision.

How it works

The algorithm counts whitespace on the first line (the headers) and 
then use the spacing information there to cut each line using the same 
number of characters that was used on the header line.

This means that cells do not need to have four spaces between them, 
except for the header row. Cells on one row are separated based on the 
number of character that was used for each column's header.

This also means that each columns take a fixed number of characters, 
causing problems if you edit with a proportional font. The only safe 
way I can see to make it proportional-font savvy would be to use a 
special column separator, like `|` pipes.

Michel Fortin
michel.fortin at

More information about the Markdown-discuss mailing list