c# - MigraDoc table border issue with left indent -
i'm trying create pdf document using migradoc, , facing issues table borders when table contains left indent.
i'm passing data following functions render table.
public void addtable(int _inumberofcolumns, double leftind) { table = section.addtable(); if (leftind != 0d) { table.format.leftindent = leftind; } (int = 0; < _inumberofcolumns; i++) { column col = table.addcolumn(); } }
in above method i'm passing double value parameter leftind
. is, believe, cause of issue.
and code add cells follows. i'm passing bool variables decide if cells border needs visible or not... (to add row i'm calling row = table.addrow();
)
public void addcolumn(int _icellnum, int icolspan, double dcellwidthinpt, system.drawing.color color, bool btopborder, bool bleftborder, bool bbottomborder, bool brightborder) { cell = row.cells[_icellnum]; if (icolspan > 0) { cell.mergeright = icolspan-1; (int = 0; < icolspan; i++) { row.cells[_icellnum + i].column.width = new unit(dcellwidthinpt, unittype.point); } } else { cell.column.width = new unit(dcellwidthinpt, unittype.point); } //brightborder = bleftborder = btopborder = bbottomborder = true; cell.borders.right.visible = brightborder; cell.borders.left.visible = bleftborder; cell.borders.top.visible = btopborder; cell.borders.bottom.visible = bbottomborder; if (color!=null) { cell.format.shading.color = new color(color.a, color.r, color.g, color.b); } }
i'm getting following output:-
if remove left indent table renders (that left indent not moving table border left).
i cannot change margin of page table part of document different margin. cannot add new section add new page.
versions:
migradoc: 1.32.3885.0
pdfsharp: 1.32.2608.0
any suggestions on may missing?
edit
this i'm trying achieve. see how table starting more left compared paragraph. achieve i'm trying use table.format.leftindent
to indent table, set table.rows.leftindent
. negative values work.
as written in comment, table.format.leftindent
sets default indentation paragraphs in table cells, moves text, not borders.
Comments
Post a Comment