Render table colspan with optional decimals for percentage

This commit is contained in:
Alexandre Mutel
2016-07-20 10:51:05 +02:00
parent 4f14ffe63b
commit 5653a4f7ee

View File

@@ -40,7 +40,7 @@ namespace Markdig.Extensions.Tables
foreach (var tableColumnDefinition in table.ColumnDefinitions)
{
var width = Math.Round(tableColumnDefinition.Width*100)/100;
var widthValue = string.Format(CultureInfo.InvariantCulture, "{0:n2}", width);
var widthValue = string.Format(CultureInfo.InvariantCulture, "{0:0.##}", width);
renderer.WriteLine($"<col style=\"width:{widthValue}%\">");
}
}