title: Convert table html to Excel in javascript
body: <p>I have a problem to convert an HTML table to an Excel file. I use </p>
  
  <pre><code>window.open ('data: application / vnd.ms-excel,' + ...
  </code></pre>
  
  <p>in javascript to perform this conversion. The problem is that the Excel file generated only has a one cell with all the HTML code inside. I need a typical table with rows and columns in Excel.</p>
  
  <p>Thanks in advance and greetings to the community. I am super newbie ... please be patient! ;)</p>
  
  <p>JAVASCRIPT CODE:</p>
  
  <pre><code>function excelSeguimientos() {
  window.open('data:application/vnd.ms-excel,' + $('#tablaSeguimientos').html());
  e.preventDefault();
  }
  </code></pre>
  
  <p>HTML CODE (TABLE):</p>
  
  <pre><code>&lt;table width="1000" id="tablaSeguimientos"&gt;
          &lt;tr bgcolor="#CCC"&gt;
            &lt;td width="100"&gt;Fecha&lt;/td&gt;
            &lt;td width="700"&gt;Seguimiento&lt;/td&gt;
            &lt;td width="170"&gt;Producto&lt;/td&gt;
            &lt;td width="30"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr bgcolor="#FFFFFF"&gt;
            &lt;td&gt;&lt;?php                 
                  $date = date_create($row_Recordset3['fecha']);
                  echo date_format($date, 'd-m-Y');
                  ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row_Recordset3['descripcion']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row_Recordset3['producto']; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;img src="borrar.png" width="14" height="14" class="clickable" onClick="eliminarSeguimiento(&lt;?php echo $row_Recordset3['idSeguimiento']; ?&gt;)" title="borrar"&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
  </code></pre>
  
  <p>Thanks for all!!</p>
  
  <p>NOTE: Is it possible to remove automatic the column with the image? Because the table is autogenerated by a mysql query, and has many rows! Thanks!</p>