title: How to format excel file with styles, fonts, colors, tables etc with pure PHP?
body: <p>I need a way to write an excel file with format through Pure PHP.
  WARNING:Please, this Q not about the libs, plugins and so on- do not disturb.
  I've googled a lot and didn`t find the Answer, but in some article on StackOverflow, some guy mentioned the HTML/CSS format way 
  <a href="https://stackoverflow.com/questions/279917/format-text-in-excel-file-via-php">HTML format solutions that didn't work</a>
   and I've tried to do this, but in file which was saved columns where filled with tags and nothing happens.
  May be there are some professionals who can help me with pure code writing an Excel through PHP, HTML, CSS or something.</p>
  
  <p>And again with example, I've already used concept like this wich didn't help:</p>
  
  <pre><code>    // headers for excel
  $headers .= "&lt;div style='font:bold 14px Times;'&gt;Журнал остатков и инкассаций&lt;/div&gt;\n";
  $headers .= "Начало периода\t ".date('d.m.Y')."0:00 \n";
  $headers .= "Начало периода\t ".date('d.m.Y')."23:59 \n\n";
  
  $headers .= "Терминал\t";
  $headers .= "Место расположения\t";
  $headers .= "Дата\t";
  $headers .= "Время\t";
  $headers .= "Сумма инкассации\t";
  $headers .= "Банкноты\t";
  
  // excel content with overloaded terminals
  if (mssql_num_rows($resCollection)&gt;0) {
    while ($rowCollection = mssql_fetch_object($resCollection)) {
  
      $data .= $rowCollection-&gt;Name."\t".$rowCollection-&gt;Address."\t"
              .$rowCollection-&gt;TerminalNotes."\t".$rowCollection-&gt;TerminalAmount
              ."\t".$rowCollection-&gt;DayAmountAll."\t"
              .$rowCollection-&gt;LastPaymentTime."\n";
  
    }
  }
  
  $fileName = 'collection'.date('d_m_Y_H_i_s').'.xls';
  
  
  header("Content-type: application/vnd.ms-excel");// application/excel had also been used
  header("Content-Disposition: attachment; filename=$fileName");
  echo iconv('utf-8', 'cp1251', "$headers\n$data"); 
  </code></pre>
  
  <p>I've used not only divs and tables too - it didn't work though.</p>