# RFC Spec extension for \*tables\*: Syntax and transformation rules

**URL:** <https://talk.commonmark.org/t/rfc-spec-extension-for-tables-syntax-and-transformation-rules/1910>\
**Category:** Extensions\
**Created:** [November 7, 2015, 11:42pm UTC](https://talk.commonmark.org/t/rfc-spec-extension-for-tables-syntax-and-transformation-rules/1910 "2015-11-07T23:42:42Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Crissov](https://talk.commonmark.org/user_avatar/talk.commonmark.org/crissov/32/1455_2.png) [@Crissov](https://talk.commonmark.org/u/Crissov)\
**Post date:** [November 8, 2015, 10:05pm UTC](https://talk.commonmark.org/t/rfc-spec-extension-for-tables-syntax-and-transformation-rules/1910/8 "2015-11-08T22:05:11Z")

</div>

1. Back-tracking is hard for both, human and computer parsers. The type of block should be determined within the first two lines.
2. Making leading pipe mandatory in most cases is a direct consequence of issue 1.
3. Trailing pipe is similar to trailing hash signs in headings. I just wanted to make clear that although the reasoning is different, they should still parallel leading pipes.
4. I’m not a big fan of hash-equals, but it is commonly used in adhoc email tables, which was the major source for original Markdown. The note on corner symbols was rather informative, not a proposal to include them.
5. Your proposal makes multi-row headers impossible. That’s bad.
6. HTML does support multiple `<tbody>` elements per table, and the `scope` attribute for headers has a `rowgroup` value. Latex’s `longtable` even allows multiple headers and footers, i.e. one on each page for tables spanning multiple pages.
7. I meant that in HTML you can have 3 explicit `<td>` in one row, 2 in the one before and 4 in the one after, but in LaTeX when you specify 3 columns you need to have 2 ampersands `&` and a line end `\\`. That’s just something to consider when deciding whether each line of a table must have the same number of pipes `|`.
8. My point was , you’re using the heading characters `=` and `-`, but “rule” (as in `<hr>`) terminology. I’ve already raised the topic of harmonization in a [thread of its own](http://talk.commonmark.org/t/harmonizing-headings-horizontal-rules-tables-and-even-bullet-lists/1876). It’s mostly a matter of consistency.
9. This follows from issues 8 and 11. I’ll explain it further down. Your plus sign `+` for `colspan` idea seems worthwhile to explore further.
10. See [this example](http://johnmacfarlane.net/babelmark2/?normalize=1&text=%7C+th+%7C+th+%7C%0A-----------%0A%7C+td+%7C+td+%7C%0A) for what I meant, I’m not sure why Maruku sees just one column, though. When I started to write my unfinished CM table syntax proposal, I tried to reuse horizontal rules, thinking that existing implementations already supported that.
11. No, you’re creating a straw man: comma, period, apostrophe, backtick and even hash sign are completely don’t apply here at all. ` **** ` and ` ____ ` are equivalent to `----` in generating horizontal rules outside “column blocks”. Normal CM text is written in an implicit 1-column block. Pipes would constitute explicit column blocks. An explicit 1-column block could be treated in a special way (like Pandoc does). I was arguing that the result of “horizontal rules” would be slightly different in explicit column blocks, i.e. `</tr><tr>` instead of `<hr>` in HTML.
12. Row header cell in HTML: `<tbody>…<tr><th scope=row>row header<td>normal content</tr>`
13. Try [`foo | bar`](http://johnmacfarlane.net/babelmark2/?normalize=1&text=foo+%7C+bar)
14. Syntax for a caption (i.e. table heading) is missing. (I forgot to mention that before.)

## Code examples for 2. (optional leading pipe)

Table started and ended with table rule:

```
---|---
 A | B
---|---

```

Table with unambiguous number of columns from first row:

```
| A | B
  C | D

```

## Code examples for 9. (possible different handling of `=` and `-` table rules)

The HTML output below only shows the contents of the `<tbody>`, the header is always the same:

```
<table><thead><tr><th> A <th> B </thead><tbody>
<!-- … -->
</tbody></table>

```

> 

```
| A | B |
|---|---|
| C | D |
| E | F |

<tr><td> C <td> D
<tr><td> E <td> F

```

[Test implementations](http://johnmacfarlane.net/babelmark2/?normalize=1&text=%7C+A+%7C+B+%7C%0A%7C---%7C---%7C%0A%7C+C+%7C+D+%7C%0A%7C+E+%7C+F+%7C%0A)

> 

```
| A | B |
|===|===|
| C | D |
| E | F |

<tr><td> C E <td> D F

```

or maybe

```
<tr><td> C<br>E <td> D<br>F

```

[Test implementations](http://johnmacfarlane.net/babelmark2/?normalize=1&text=%7C+A+%7C+B+%7C%0A%7C%3D%3D%3D%7C%3D%3D%3D%7C%0A%7C+C+%7C+D+%7C%0A%7C+E+%7C+F+%7C%0A)

> 

```
| A | B |
|===|===|
| C | D |
|---|---|
| G | H |

<tr><td> C <td> D
<tr><td> G <td> H

```

[Test implementations](http://johnmacfarlane.net/babelmark2/?normalize=1&text=%7C+A+%7C+B+%7C%0A%7C%3D%3D%3D%7C%3D%3D%3D%7C%0A%7C+C+%7C+D+%7C%0A%7C---%7C---%7C%0A%7C+G+%7C+H+%7C%0A)

> 

```
| A | B |
|===|===|
| C | D |
|---| F |
| G | H |

<tr><td> C <td rowspan=2> D F H
<tr><td> G

```

or maybe

```
<tr><td> C <td rowspan=2> D<br>F<br>H
<tr><td> G

```

[Test implementations](http://johnmacfarlane.net/babelmark2/?normalize=1&text=%7C+A+%7C+B+%7C%0A%7C%3D%3D%3D%7C%3D%3D%3D%7C%0A%7C+C+%7C+D+%7C%0A%7C---%7C+F+%7C%0A%7C+G+%7C+H+%7C%0A)

---

_[View the full topic](https://talk.commonmark.org/t/rfc-spec-extension-for-tables-syntax-and-transformation-rules/1910)._
