setPaddings method

setPaddings(leftPadding, topPadding, rightPadding, bottomPadding)

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

setPaddings(leftPadding: number, topPadding: number, rightPadding: number, bottomPadding: number)
ParameterTypeDescription
leftPaddingnumber
topPaddingnumber
rightPaddingnumber
bottomPaddingnumber

Examples

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

let doc = new aw.Document();
let builder = new aw.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(base.artifactsDir + "CellFormat.Padding.docx");

See Also