I have a FlowDocument table where I want to spice up the layout a bit. I'm thinking something like a thin line separating the sub amounts on an invoice from the total or something like the line under the header row typically featured in the standard Word 2007+ table styles. I was hoping that I could just add an empty TableRow and set the height to a few pixel units, but I find no property to force the height of a row to my desire.
Is there a way (or hack) to make a thin border line under or over an entire row in a System.Windows.Documents.Table?
When I print this out it just looks like a feint line.
<TableRow FontSize="0.008">
<TableCell Padding="0" BorderBrush="Gray" BorderThickness="0.5" ColumnSpan="5" />
</TableRow>
Make sure the Table has CellSpacing="0"
I define TableColumns for vertical lines between columns:
<Table.Columns>
<TableColumn Width="140" Name="colItems" />
<TableColumn Width="0" Name="colSpace1" />
<TableColumn Name="colDescription" />
<TableColumn Width="0" Name="colSpace2" />
<TableColumn Width="150" Name="colAmount"/>
</Table.Columns>
Then in a TableRowGroup for the Header row:
<TableRow FontSize="14">
<TableCell TextAlignment="Center" Padding="0,4,0,2">
<Paragraph>ITEMS</Paragraph>
</TableCell>
<TableCell BorderBrush="Gray" BorderThickness="0.5" />
<TableCell TextAlignment="Center" Padding="0,4,0,2">
<Paragraph>DESCRIPTION</Paragraph>
</TableCell>
<TableCell BorderBrush="Gray" BorderThickness="0.5" />
<TableCell TextAlignment="Center" Padding="0,4,0,2">
<Paragraph>AMOUNT</Paragraph>
</TableCell>
</TableRow>
Oliver
Worked out a hack myself. Setting the FontSize to something small enabled me to compress the row height.
<TableRow Background="Black" FontSize="0.01">
<TableCell ColumnSpan="2" />
</TableRow>
The above works, but the line is still rather thick. Any suggestions to reduce the height even further?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With