1

May i know how to press a button and download an excel(.xlsx), the excel will need to contain all the values. Some of the table is an input, need to download the input value.

My html code look like this:

<table id="tabledata" border=1>
<tr><td>X</td><td>Y</td><td></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX1"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY1"></td><td><button onclick="remove(1)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX2"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY2"></td><td><button onclick="remove(2)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX3"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY3"></td><td><button onclick="remove(3)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX4"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY4"></td><td><button onclick="remove(4)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX5"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY5"></td><td><button onclick="remove(5)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX6"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY6"></td><td><button onclick="remove(6)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX7"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY7"></td><td><button onclick="remove(7)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX8"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY8"></td><td><button onclick="remove(8)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX9"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY9"></td><td><button onclick="remove(9)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX10"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY10"></td><td><button onclick="remove(10")>Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX11"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY11"></td><td><button onclick="remove(11)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX12"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY12"></td><td><button onclick="remove(12)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX13"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY13"></td><td><button onclick="remove(13)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX14"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY14"></td><td><button onclick="remove(14)">Remove</button></td></tr>
<tr><td class="tabledatacell"><input type="text"onkeyup=""  id="dataX15"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY15"></td><td><button onclick="remove(15)">Remove</button></td></tr>
</table>
</td></tr>
</table>
Vijay Joshi
  • 919
  • 7
  • 17
Joshua Tan
  • 23
  • 4

0 Answers0