aVadim483 / fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP
MIT License
163 stars 31 forks source link

Auto size column #11

Closed ishamshur closed 2 years ago

ishamshur commented 2 years ago

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?
aVadim483 commented 2 years ago

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
aVadim483 commented 2 years ago
  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

aVadim483 commented 2 years ago

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']);