我制作了一个动态添加行到我的 html 表的表,它也动态地将删除按钮添加到行中。单击表格标题时,我需要排列列!
<body>
<div id="app">
<form id="organiser">
<label id="heading">Organiser</label>
<br/>
<br/>
<label>No:</label>
<input type="text" id="description"/>
<br/>
<label>Importance Level:</label>
<select id="options1">
<option value=" 1 " name="1" id="1"> 1 </option>
<option value=" 2 " name="2" id="2"> 2 </option>
<option value=" 3 " name="3" id="3"> 3 </option>
</select>
<br/>
<label>Due Date:</label>
<input type="date" id="date" />
<br/>
<input type="button" id="add" value="Add" onClick="addRowToTable();"/>
</form>
<br/>
<table border="1" id="table">
<tr>
<th>No</th>
<th>Task</th>
<th>Importance</th>
<th>Date Tasks Due</th>
<th></th>
</tr>
</table>
</div>
</body>