title: PHPSpreadsheet auto row height not works with LibreOffice latest version
body: <p>I am using PHPSpreadsheet now, I am trying to get rows to auto height. It is working fine in <strong>MSOffice</strong> But Not work in <strong>LibreOffice</strong>. </p>
  
  <blockquote>
    <p>Question How to make the row auto height work in <strong>LibreOffice</strong> latest version. Works fine in <strong>MSOffice</strong>.</p>
  </blockquote>
  
  <p>Autoheight</p>
  
  <pre><code>$spreadsheet-&gt;getActiveSheet()-&gt;getRowDimension(1)-&gt;setRowHeight(-1);
  
  foreach($spreadsheet-&gt;getActiveSheet()-&gt;getRowDimensions() as $rowID) { 
      $rowID-&gt;setRowHeight(-1); 
  }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>&lt;?php
  
  require(APPPATH . 'vendor/autoload.php');
  
  use PhpOffice\PhpSpreadsheet\Spreadsheet;
  
  class Events extends MX_Controller {
  
      public function test() {
          $spreadsheet = new Spreadsheet();
  
          $spreadsheet-&gt;getProperties()-&gt;setCreator('')
                  -&gt;setLastModifiedBy('')
                  -&gt;setTitle('')
                  -&gt;setSubject('')
                  -&gt;setDescription('');
  
          $spreadsheet-&gt;getDefaultStyle()-&gt;getFont()-&gt;setName('Arial');
          $spreadsheet-&gt;getDefaultStyle()-&gt;getFont()-&gt;setSize(24);
  
          foreach(range('A','B') as $columnID) {
              $spreadsheet-&gt;getActiveSheet()-&gt;getColumnDimension($columnID)-&gt;setAutoSize(true);
          }
  
          $spreadsheet-&gt;getActiveSheet()-&gt;getStyle('A')-&gt;getAlignment()-&gt;setWrapText(true);
  
          $spreadsheet-&gt;getActiveSheet()-&gt;getRowDimension(1)-&gt;setRowHeight(-1);
  
          foreach($spreadsheet-&gt;getActiveSheet()-&gt;getRowDimensions() as $rowID) { 
              $rowID-&gt;setRowHeight(-1); 
          }
  
          $spreadsheet-&gt;setActiveSheetIndex(0)
                  -&gt;setCellValue("A1",'Firstname')
                  -&gt;setCellValue("B1",'Lastname')
                  -&gt;setCellValue("A2",'John')
                  -&gt;setCellValue("B2",'Doe');
  
  
          $spreadsheet-&gt;getActiveSheet()-&gt;setTitle('Users Information');
  
          $spreadsheet-&gt;setActiveSheetIndex(0);
  
          /* Here there will be some code where you create $spreadsheet */
  
          // redirect output to client browser
          header('Content-Type: application/vnd.ms-excel');
          header('Content-Disposition: attachment;filename="myfile.xls"');
          header('Cache-Control: max-age=0');
  
          $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
          $writer-&gt;save('php://output');
  
          exit;
  
      }
  }
  </code></pre>