title: How to customize header cell in PDF using jsPDF-AutoTable plugin?
body: <p>I encountered strange bug when tried to convert HTML to pdf using <strong>jsPDF-AutoTable</strong> plugin. According to <a href="https://github.com/simonbengtsson/jsPDF-AutoTable" rel="noreferrer">official Github page</a> there is possibility to customize any headerCell and ordinary cell by using <code>createdHeaderCell</code> and <code>createdCell</code> hooks. I used the code below to change styling for particular header and row cells (<code>Name</code> header and <code>Jack</code> cell). I also upload this code <a href="http://jsfiddle.net/6343vevc/" rel="noreferrer"><strong>here</strong></a>.</p>
  
  <pre><code>$('#btn').click(function(){
  
              var columns = ['ID','Name','Address','Age'];
              var rows = [
              [1,'John','Vilnius',22],
              [2,'Jack','Riga',25]
              ];
  
              var doc = new jsPDF('p', 'pt');
  
              doc.setFontSize(20);
              doc.text(30, 30, 'Table'); 
  
              doc.autoTable(columns, rows, {
                  margin: { top: 50, left: 20, right: 20, bottom: 0 },
                  createdHeaderCell: function (cell, data) {
                      if (cell.raw === 'Name') {
                          cell.styles.fontSize= 15;
                         cell.styles.textColor = 111;
                      } else {//else rule for drawHeaderCell hook
                          cell.styles.textColor = 255;
                          cell.styles.fontSize = 10;
  
                      }
                  },
                     createdCell: function (cell, data) {
                      if (cell.raw === 'Jack') {
                         cell.styles.fontSize= 15;
                         cell.styles.textColor = 111;
                      } 
                  }
              });
  
              doc.save('output.pdf');
  });
  </code></pre>
  
  <p>In this code <code>createdCell</code> hook works as expected and style the cell with <code>Jack</code>, but nothing happened for <code>Name</code> header. Did I miss something or is it a bug?</p>
  
  <p>The funny thing that I find strange workaround using <code>drawHeaderCell</code> instead of <code>createdHeaderCell</code>, but in this case styling occurs for next <code>Address</code> header, not the <code>Name</code>as I wanted. My workaround: I used previous <code>ID</code> header to style <code>Name</code>, but this solution not very beautiful, because I should use <code>else</code> rule for styling, otherwise styling will be applied for all headers after <code>ID</code>, not just <code>Name</code>, so I want to find out what is wrong with my initial code.</p>
  
  <p>Thank you for you attention.</p>