1

how to align the numeric data to right in exportpdf jquery datatable

i have tried this below code but it getting for all columns i need only for numeric data columns

doc.defaultStyle.alignment = 'right';

doc.defaultStyle.alignment = 'right';

1 Answers1

0

Can try this

// Change 5th column to right align
 var rowCount = doc.content[1].table.body.length;
 for (i = 0; i < rowCount+1; i++) {
    doc.content[1].table.body[i][5].alignment = 'right';
 };

Refer this for more detail

MyTwoCents
  • 7,284
  • 3
  • 24
  • 52