Any news re tables and Markdown?

Már Örlygsson mar at anomy.net
Fri Mar 11 04:23:56 EST 2005


> How often are multiple-row cells necessary, however? And how much
> work are they to create, even in a real text editor

I think that even if they were only necessary in one in every 8-10 
tables, it'd still make sense to support them.
My guess is that wrapping cell contents between lines is a fairly common 
need - especially when writing markdown in a situation like e-mail where 
line lengths are limited to around 70 characters.

I'd be willing to go with "multiple lines, but only one paragraph per 
table cell".
That is to say that things like <h1>...<h6>, <ol> and <ul>, <blockquote> 
and multiple <p> should be disallowed from table cells, but cell 
contents should be allowed to wrap, if an optional "--------" row 
deliminator is used.


On the subject of table headings (<th>) I think we could do them quite 
reliably by saying that if the contents of a cell end with a colon (:), 
that cell sould be assumed to be a <th>. The trailing colon could be 
stripped out, so if the author wants the cell content to end with an 
actual colon she'd need to type in two colons like this:

                 Header1:    Header2:
     ----------  ----------  ---------
     Rowhead1::  cell A      cell B
     Rowhead2::  cell C      cell D

which would produce this HTML


     <table>
       <tr> <th></th>          <th>Header1</th> <th>Header2</th> </tr>
       <tr> <th>Rowhead1:</th> <td>cell A</td>  <td>cell B</td>  </tr>
       <tr> <th>Rowhead1:</th> <td>cell C</td>  <td>cell D</td>  </tr>
     </table>

or with an optional syntax to allow multiple lines per cell:

                 Header1:    Header2:
     ----------  ----------  ------------
     Rowhead1::  cell A      Squeeze more
                             stuff into
                             cell B
     ----------  ----------  ------------
     Rowhead2::  cell C      cell D
     ----------  ----------  ------------



> what if you want a table with only one column?

How about using a bullet list then? :-)
I've always felt that single column tables were just a simple list with 
the wrong markup. I suggest that markdown should not support that 
particular edge-case at all.



-- 
Már Örlygsson
------------------------------
mailto:mar at anomy.net
http://mar.anomy.net


More information about the Markdown-Discuss mailing list