Semi on, semi off topic … it’d be interesting if there could also be a standardized way of communicating what extensions a given site/app use, perhaps a list of small icons (though yes, I know small icons have their own UX issues) … that would a) leave things open for extension, and b) give users a way of knowing what’s available.
This should be a core Markdown feature, IMO. This is not a specialized plugin like referencing users using @... or referencing an issue on GitHub with #....
Given the alternative between typing this:
| Header | Another Header |
|---------|----------------|
| field 1 | value one |
Markdown was designed to make it easy to format things. Markdown exists to make <a href="http://domain.com">this link</a> turn into [this link](http://domain.com).
I fail to see why tables shouldn’t be made a standard Markdown feature.
Just to offer a very slightly different perspective … although a nicely formatted “markdown table” is really nice to look at and read, it’s not nice to author and maintain. Imagine a long table, where every row had cell contents of different lengths … it either looks like an unaligned mess that’s impossible to parse visually, or it’s a nightmare to go through and update every row’s whitespace count so the pipes line up when viewed after some new content has been added or updated.
IMO, markdown should be easy to author first, easy to read without first converting to HTML second.
That being said, I don’t disagree that it shouldn’t be a part of the spec … just offering a different perspective
That’s true, I definitely agree that it’s a drawback and can prove to be annoying at times to author and maintain tables in this fashion. If there’s a better, more intuitive solution, I’m all for it, so long as it doesn’t look like <table>...</table>
oh I know it still parses correctly … but if the table is longer than that, or has more columns, it can be very difficult to parse visually (which an author would have to do in order to update and maintain the content). It gets even worse when you’re working with an editor that wraps a line (sublime, vim, et al)
The syntax is very similar in LaTeX and even in HTML large tables are large tables. I think that’s ok to parse for humans. You just count some pipes as you would count some <td>s. This should be ok for the average joe.
By “core markdown,” I meant simply the sorts of elements that are
supported in John Gruber’s original markdown: block quotes, lists,
etc. Tables and footnotes are not among them. I would be happy to
see markdown grow organically to have a table syntax (though I don’t
particularly like “pipe tables” – see pandoc for some nicer plain
text table formats). But it would be better to discuss that after
settling current core features.
(Alternately, you can explicitly open a <tbody>, which will implicitly close the <thead>. The markup above generates a <tbody> for you when parsed, but sometimes you want an explicit element to put a class on or something, or to separate out multiple sections of body data.)
But anyway, I agree that tables should show up at some point in MD.
While I agree that tables are an important use case in Markdown, I suspect that standardization will be contentious, not in whether people want them or not (that answer is clearly yes), but in the exact details of what syntax to support. For example, Pandoc currently supports at least four different syntaxes for tables:
I agree with @jgm on this one that the most important goal for this spec is to nail down the core (as in Markdown.pl) language, and let the rest happen via extensions later. It’s not like anyone’s Markdown parser is going to stop supporting tables just because it isn’t included in the spec 1.0.
For normal stuff, I don’t really see how it’s that much different. You can just as well add whitespace to align the columns etc. The only extra thing are the row separators and the leading {| and trailing |}.
Yes, those extra things are the things that don’t look like plain text. Additionally, the use of ! for headers is unusual. The syntax in the OP, used by MarkdownExtra, looks like a plain-text table you’d see people manually write in an email or the like, which is precisely the aesthetic that Markdown adheres to and what makes it attractive. Taken together, MediaWiki tables look nothing like a table; nobody unfamiliar with the syntax would understand what it was trying to do when looking at the source.
(MarkdownExtra has a special syntax for header alignment which doesn’t map to plain-text conventions, using a colon on the separator line below the header, which is weird. I’ve seen similar support for this feature by literally aligning the text; putting any whitespace on one or both sides between the header text and the pipes aligns the text accordingly. This is a better syntax, because it looks natural, does what it looks like, and acts correctly by default (centering when there’s no space or space on both sides).)
To be honest, I see it as a failing of HTML that we can’t use a syntax such as
<table src="data.csv"></table>
to separate data from markup.
Of course, it’s possible to polyfill the behavior using
<table data-src="data.csv"></table>
and a bit of javascript.
Overall, tables would add a level of complexity that probably belongs in an extension. That way, a standards compliant markdown parser can choose not to support tables, or choose to handle tables in a different manner.