linways/table-to-excel

Error when table has two columns

dviluk opened this issue · 2 comments

Hello, i have an error when using two columns

TypeError: e.columns[r] is undefined

I just modify the HTML on demo

<table id="simpleTable1" data-cols-width="70,15,10">
        <tbody>
          <tr>
            <th data-a-text-rotation="-45">Col 4 (date)</th>
            <th data-a-text-rotation="-90">Col 5</th>
          </tr>
          <tr>
            <td data-t="d">05-20-2018</td>
            <td data-t="n" data-num-fmt="$ 0.00">2210.00</td>
          </tr>
        </tbody>
      </table>

      <button id="button-excel">Create Excel</button>

@dviluk I think this is same as #10 . Please match number of items in data-cols-width with number of columns.
try

<table id="simpleTable1" data-cols-width="70,15">
        <tbody>
          <tr>
            <th data-a-text-rotation="-45">Col 4 (date)</th>
            <th data-a-text-rotation="-90">Col 5</th>
          </tr>
          <tr>
            <td data-t="d">05-20-2018</td>
            <td data-t="n" data-num-fmt="$ 0.00">2210.00</td>
          </tr>
        </tbody>
      </table>

Too fast!
Yes you are right! thank you!