KeepWithNext
Contenuti
[
Nascondere
]ParagraphFormat.KeepWithNext property
Vero se il paragrafo deve rimanere sulla stessa pagina del paragrafo che lo segue.
public bool KeepWithNext { get; set; }
Esempi
Mostra come apparecchiare la tavola in modo che tutti siano sulla stessa lunghezza d’onda.
Document doc = new Document(MyDir + "Table spanning two pages.docx");
Table table = doc.FirstSection.Body.Tables[0];
// Abilitazione di KeepWithNext per ogni paragrafo nella tabella eccetto per
// gli ultimi nell'ultima riga impediranno che la tabella venga suddivisa su più pagine.
foreach (Cell cell in table.GetChildNodes(NodeType.Cell, true))
foreach (Paragraph para in cell.Paragraphs)
{
Assert.True(para.IsInCell);
if (!(cell.ParentRow.IsLastRow && para.IsEndOfCell))
para.ParagraphFormat.KeepWithNext = true;
}
doc.Save(ArtifactsDir + "Table.KeepTableTogether.docx");
Guarda anche
- class ParagraphFormat
- spazio dei nomi Aspose.Words
- assemblea Aspose.Words