Would love a right indent to be available. #3299
Closed
4DSecurity
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
The following seems to do what you want. use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
// Create new Spreadsheet object
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->getCell('A1')->setValue('XYZ');
$sheet->getStyle('A1')->getAlignment()
->setHorizontal(Alignment::HORIZONTAL_RIGHT)
->setIndent(1);
$writer = new Xlsx($spreadsheet);
$outfile = 'issue.3299.indent.xlsx';
$writer->save($outfile); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The indent feature is excellent for putting a small amount of padding in cells. However, right justified text in a cell Hasn't got the same possibility which means text is always pushed hard to the right of the cell. Really could do with a right indent feature, as found in Excel spreadsheet cells.
Beta Was this translation helpful? Give feedback.
All reactions