title: Removing specific html column on excel export - javascript
body: <p>I am exporting an html table to excel using IE9, and i want to avoid specific column on export. Currently using a javascript function.</p>
  
  <p>I have totally 16 columns where i want to avoid 14th column on export. Can anyone help? Thanks for your time!</p>
  
  <p>My code : </p>
  
  <pre><code>function ExcelReport() {
          var tab_text = "&lt;table border='2px'&gt;&lt;tr border='1px'&gt;";
          var tabcol = "&lt;td&gt;";
          var j = 0;
          var i = 0;
          tab = document.getElementById('myTable'); 
          var col = tab.rows[1].cells.length;
  
          //row[0] is table header
          tab_text = tab_text + tab.rows[0].innerHTML + "&lt;/td&gt;&lt;/tr&gt;";
  
          for (j = 1; j &lt; tab.rows.length; j++) {
              for(i = 0 ;i&lt; col;i++){
                  tabcol = tabcol + tab.rows[j].cells[i].innerHTML + "&lt;/td&gt;";
              }
              tab_text = tab_text + tabcol + "&lt;/tr&gt;";
          }
  
          tab_text = tab_text + "&lt;/table&gt;";
  
          var ua = window.navigator.userAgent;
          var msie = ua.indexOf("MSIE ");
  
          if (msie &gt; 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer
          {
              txtArea1.document.open("txt/html", "replace");
              txtArea1.document.write(tab_text);
              txtArea1.document.close();
              txtArea1.focus();
              sa = txtArea1.document.execCommand("SaveAs", true,"Report.xls");
          } 
  
          return (sa);
      }
  </code></pre>
  
  <p>This code doesn't work. What should be done to remove the 14th column from the table. Can anyone help please?</p>