dotmarkdown
dotmarkdown copied to clipboard
How to create a Table?
I don't understand how to use for instance DotMarkdown.MarkdownBaseWriter.WriteStartTableCell()
I get exceptions, like:
Cannot write 'TableCell' when state is 'Table'
How do I get out of that state? In what order should the methods be called?
Hi,
You have to start with WriteStartTable
:
-
WriteStartTable
-
WriteStartTableRow
-
WriteStartTableCell
-
-
This is not convenient way how to create markdown table.
Recommended approach is similar how XML document is created with System.Xml.Linq.XElement.
Extensive usage of this approach can be found here.
MTable type uses MarkdownWriter under the hood.
I will try this second method out tonight.
I got the first way working before you answered, but the table output was not what I expected.
@vonj any progress?