aVadim483 / fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto size column

ishamshur opened this issue · comments

Hi.
Trying to switch from PhpSpreadsheet to your solution and have a few questions:

  1. PhpSpreadsheet has a setAutoSize() function which sets the automatic column size by content. Do you have something similar? Or do you have to manually set the width and height for each column?
  2. Is there some way to make a URL link to the cell?

Hi,

  1. You can set width of columns and height of rows manually, see demo https://github.com/aVadim483/fast-excel-writer/blob/master/demo/demo-03-widths-heights.php. A setAutoSize() function is not exists but I'll think about it
  2. Not yet but I'll try do it
  1. PhpSpreadsheet has a setAutoSize() function which sets the automatic column size by content. Do you have something similar? Or do you have to manually set the width and height for each column?

Yes, now you can, see https://github.com/aVadim483/fast-excel-writer#height-and-width

Well, now you can insert active hyperlinks into cells

// Write URL as simple string (not hyperlink)
$sheet->writeCell('https://google.com');

// Write URL as an active hyperlink
$sheet->writeCell('https://google.com', ['hyperlink' => true]);

// Write text with an active hyperlink
$sheet->writeCell('Google', ['hyperlink' => 'https://google.com']);