We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is:
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
this issue is based on Maatwebsite/Laravel-Excel which internally use PhpSpreadsheet SpartnerNL/Laravel-Excel#2784
Maatwebsite/Laravel-Excel
PhpSpreadsheet
<table style="width:100%" border="1"> <thead> <tr> // ... <th style="text-align: center;" colspan="4">{{ __('Items') }}</th> // ... </tr> <tr> // ... </tr> </thead> @foreach ($models->cursor() as $model) <tbody> <tr> // ... <td colspan="4"> <table style="width:100%"> @foreach ($model->relation as $item) <tr> // ... </tr> @endforeach </table> </td> // ... </tr> </tbody> @endforeach </table>
public function registerEvents(): array { return [ AfterSheet::class => function (AfterSheet $event) { $sheet = $event->sheet->getDelegate(); $sheet->getRowDimension(1)->setRowHeight(30); $header = $sheet->getStyle('A1:' . $sheet->getHighestDataColumn() . '1'); $header->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER); $header->getFont()->setBold(true); $header->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)->getStartColor()->setARGB('00000000'); $header->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_WHITE); $other = $sheet->getStyle('A2:' . $sheet->getHighestDataColumn() . $sheet->getHighestRow()); $other->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP); foreach ([$header, $other] as $item) { $item->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); $item->getAlignment()->setWrapText(true); } }, ]; }
PHPSpreadsheet ^1.14 Php ^7.0
PHPSpreadsheet ^1.14
Php ^7.0
if you need any more info, plz ask.
The text was updated successfully, but these errors were encountered:
https://stackoverflow.com/questions/63356980/phpspreadsheet-how-to-export-html-with-sub-headers
Sorry, something went wrong.
No branches or pull requests
This is:
What is the expected behavior?
What is the current behavior?
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
PHPSpreadsheet ^1.14
Php ^7.0
if you need any more info, plz ask.
The text was updated successfully, but these errors were encountered: