Goldmark, Hugo, Tables and colspan?

Hi,
I would like to refresh 27388 and ask how you achieve margin cells in a table.

As hugo using Goldmark as a markdown processor and table.go refers to colspan I wonder how it is used?

Just adding <th colspan="2> doing the job but is adding empty breaking table layout

Base:

| A | B | | |
| - | - | - | - |
| 1 | 0.1 | 0.5 | 1 |

Issue:

| A <th colspan="3"> B |
| - | - | - | - |
| 1 | 0.1 | 0.5 | 1 |
// TableThCellAttributeFilter defines attribute names which table <th> cells can have.
var TableThCellAttributeFilter = html.GlobalAttributeFilter.Extend(
	[]byte("abbr"), // [OK] Contains a short abbreviated description of the cell's content [NOT OK in <td>]

	[]byte("align"),   // [Obsolete since HTML5]
	[]byte("axis"),    // [Obsolete since HTML5]
	[]byte("bgcolor"), // [Not Standardized]
	[]byte("char"),    // [Obsolete since HTML5]
	[]byte("charoff"), // [Obsolete since HTML5]

	[]byte("colspan"), // [OK] Number of columns that the cell is to span
	[]byte("headers"), // [OK] This attribute contains a list of space-separated strings, each corresponding to the id attribute of the <th> elements that apply to this element

	[]byte("height"), // [Deprecated since HTML4] [Obsolete since HTML5]

	[]byte("rowspan"), // [OK] Number of rows that the cell is to span
	[]byte("scope"),   // [OK] This enumerated attribute defines the cells that the header (defined in the <th>) element relates to [NOT OK in <td>]

	[]byte("valign"), // [Obsolete since HTML5]
	[]byte("width"),  // [Deprecated since HTML4] [Obsolete since HTML5]
)

Untested, but it might be { colspan="3" } inside of the table cell markup. Try it at the end and the beginning.

| A | B { colspan="3" } |
| - | - | - | - |
| 1 | 0.1 | 0.5 | 1 |

If that is working it might be useful to add that somewhere to the documentation.

Hey @bep
I assume that text in gohugo news section is written in Markdown and then converted.
May I ask how in markdown you achieved colspan as seen here?

It’s just an HTML file with YAML front matter:

hugo new content/foo.html

A, ok.

I figure out for my need a dirty shortcode that will work with in markdown with but think, as Hugo is using goldmark, that we would benefit if we look into implementing that or at least following with markdown.

Hope will get this on some point.

Thanks