I can't find anything related to this issue I'm having, but the table property KeepTogether and the Row property Keepwith doesn't work on rtf
I made some code that lets me replicate the issue:
Code:
int ncols = 6;
int nrows = 50;
float pageWidth = 560f;
float colSize = pageWidth / ncols;
var doc = new MigraDocument();
doc.LastSection.AddParagraph(Lorem);
doc.LastSection.AddParagraph(Ipsum);
var tab = doc.LastSection.AddTable();
for (int i = 0; i < ncols; ++i)
tab.AddColumn(colSize);
for (int i = 0; i < nrows; ++i)
{
var row = tab.AddRow();
if (i == 0)
row.HeadingFormat = true;
for (int j = 0; j < ncols; ++j)
{
if (i == 0)
{
row.Cells[j].Format.Shading.Color = Colors.DarkBlue;
row.Cells[j].Format.Font.Color = Colors.White;
}
else if (i % 2 == 0)
{
row.Cells[j].Format.Shading.Color = Colors.AliceBlue;
row.Cells[j].Format.Font.Color = Colors.White;
}
row.Cells[j].AddParagraph(j + " : " + i);
row.Cells[j].Borders.Width = 0.5;
row.Cells[j].RoundedCorner = RoundedCorner.BottomLeft | RoundedCorner.BottomRight | RoundedCorner.TopLeft | RoundedCorner.TopRight;
}
}
tab.Rows.Alignment = RowAlignment.Center;
tab.Rows[0].KeepWith = tab.Rows.Count;
tab.KeepTogether = true;
saving/rendering this document as a rtf, does not give the expected output, since the table is split between the first and second pages.
Saving/rendering this document as a pdf, the result is the full table, on the second page, as per expected.
is there any way to make the tables NOT break on rtf?