Skip to content

Commit

Permalink
add: Sheet::setPrintHorizontalCentered();
Browse files Browse the repository at this point in the history
Sheet::setPrintVerticalCentered();
Sheet::setPrintCentered();
upd docs
  • Loading branch information
aVadim483 committed Nov 1, 2024
1 parent 4ca7e76 commit 83fcd70
Show file tree
Hide file tree
Showing 9 changed files with 637 additions and 258 deletions.
23 changes: 23 additions & 0 deletions docs/02-sheets.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ $sheet1->pagePaperSize(Excel::PAPERSIZE_A3);
$sheet1->pagePaperHeight('297mm');
$sheet1->pagePaperWidth('21cm');
```
By default, the values are set in inches, 1 inch is 2.54 cm. So when you specify numeric values, they are specified in inches.

But you can also specify these values in centimeters or millimeters.

```php
$sheet1->pageMarginLeft(0.5); // set left margin 0.5 inch
$sheet1->pageMarginLeft('0.5cm'); // set left margin 0.5 centimeters
$sheet1->pageMarginLeft('0.5mm'); // set left margin 0.5 millimeters
```


### Freeze Panes and Autofilter

Expand Down Expand Up @@ -378,4 +388,17 @@ To show/hide gridlines when printing, use the following code:
$sheet->setPrintGridlines(true);
```

You can center print area on a page

```php
// horizontal centered (default param is true)
$sheet->setPrintHorizontalCentered();

// vertical centered
$sheet->setPrintVerticalCentered();

// centered both direction
$sheet->setPrintCentered();
```

Returns to [README.md](/README.md)
6 changes: 6 additions & 0 deletions docs/90-api-reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# FastExcelWriter - API Reference

---

namespace **avadim\FastExcelWriter**

---

* [Class Excel](91-api-class-excel.md)
* [Class Sheet](92-api-class-sheet.md)
* [Class RichText](93-api-class-rich-text.md)
Expand Down
Loading

0 comments on commit 83fcd70

Please sign in to comment.