HTML таблица, чтобы преуспеть, используя JavaScript - PullRequest
1 голос
/ 06 февраля 2020

Могу ли я узнать, как нажать кнопку и загрузить Excel (.xlsx), Excel должен содержать все значения. Часть таблицы является входной, необходимо загрузить входное значение.

Мой html код выглядит следующим образом:

<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>
...