SetPaddings

CellFormat.SetPaddings method

Sets the amount of space (in points) to add to the left/top/right/bottom of the contents of cell.

public void SetPaddings(double leftPadding, double topPadding, double rightPadding, 
    double bottomPadding)

Examples

Shows how to pad the contents of a cell with whitespace.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Set a padding distance (in points) between the border and the text contents
// of each table cell we create with the document builder. 
builder.CellFormat.SetPaddings(5, 10, 40, 50);

// Create a table with one cell whose contents will have whitespace padding.
builder.StartTable();
builder.InsertCell();
builder.Write("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " +
              "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.");

doc.Save(ArtifactsDir + "CellFormat.Padding.docx");

See Also