Grid table without table column widths #375

Closed
opened 2026-01-29 14:35:17 +00:00 by claunia · 2 comments
Owner

Originally created by @2steuer on GitHub (Jun 10, 2020).

Hi,
First off: I just discovered your package yesterday and it is exactly what I was looking for. Absolutely works like a charm for my use case. Thank you!

I just have one little request: Is it possible to disable the column width output for grid tables? If not, could you give me a little hint where to look - I will be very happy to submit a pull request then.

Thank you!

Merlin

Originally created by @2steuer on GitHub (Jun 10, 2020). Hi, First off: I just discovered your package yesterday and it is exactly what I was looking for. Absolutely works like a charm for my use case. Thank you! I just have one little request: Is it possible to disable the column width output for grid tables? If not, could you give me a little hint where to look - I will be very happy to submit a pull request then. Thank you! Merlin
claunia added the questionenhancement labels 2026-01-29 14:35:17 +00:00
Author
Owner

@MihaZupan commented on GitHub (Jun 10, 2020):

I'd say the easiest way to achieve it is to reset column widths after parsing the document

MarkdownDocument document = Markdown.Parse(markdownText, pipeline);

foreach (Table table in document.Descendants<Table>())
{
    foreach (TableColumnDefinition columnDefinition in table.ColumnDefinitions)
    {
        columnDefinition.Width = 0.0f;
    }
}
@MihaZupan commented on GitHub (Jun 10, 2020): I'd say the easiest way to achieve it is to reset column widths after parsing the document ```c# MarkdownDocument document = Markdown.Parse(markdownText, pipeline); foreach (Table table in document.Descendants<Table>()) { foreach (TableColumnDefinition columnDefinition in table.ColumnDefinitions) { columnDefinition.Width = 0.0f; } } ```
Author
Owner

@2steuer commented on GitHub (Jun 10, 2020):

Ah, that is one solution, great!
I had looked into HtmlRenderer and the Html Renderer for GridTables, but I have too little knowledge where to modify their properties while parsing/rendering. In my simple mind it'd be a "InlcudeColumnWidths" Property which is a condition around the few lines of code that print the elements.

This, however, looks like a fine way of accomplishing it for now.

Thank you!

@2steuer commented on GitHub (Jun 10, 2020): Ah, that is one solution, great! I had looked into HtmlRenderer and the Html Renderer for GridTables, but I have too little knowledge where to modify their properties while parsing/rendering. In my simple mind it'd be a "InlcudeColumnWidths" Property which is a condition around the few lines of code that print the <col /> elements. This, however, looks like a fine way of accomplishing it for now. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#375