isCenterHorizontally property

bool isCenterHorizontally
getter/setter pair

Indicates whether to center the sheet content horizontally when it is printed.

final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
sheet.getRangeByName('A1:D4').text = 'Hello';
sheet.pageSetup.isCenterHorizontally = true;
final List<int> bytes = workbook.saveAsStream();
saveAsExcel(bytes, 'isCenterHorizontally.xlsx');
workbook.dispose();

Implementation

late bool isCenterHorizontally;