好的,所以我有一个HTML jquery tablesorter网页。我不想将所有“td”标签嵌入到同一个文件中,而是希望从单独的文件中加载它们。原因是数据非常大,而且它是模块化所必需的。下面是我想到目前为止....包含外部html表格数据
<div id="demo"><table class="tablesorter">
<script src="https://www.w3schools.com/lib/w3.js"> w3.includeHTML();</script>
<br>
<!-- Table Head -->
<thead>
<tr>
<th>Sensor</th> <!-- disable dragtable on this column -->
<th class="drag-enable">c1</th>
<th class="drag-enable">c2</th>
<th class="drag-enable">c3</th>
<th class="drag-enable">c4</th>
<th class="drag-enable">c5</th>
<th class="drag-enable">c6</th>
</tr>
</thead>
<!-- Table Footer -->
<tfoot>
<tr><th>c1</th><th>c2</th><th>c3</th><th>c4</th><th>c5</th><th>c6</th><th>c7</th></tr>
</tfoot>
<!-- Table Content -->
<tbody w3-include-html="C:\Users\user\Desktop\new_test\tabledata.html">
</tbody>
</table>
</div>
那么,你面临什么问题? –
如果你有很多数据,那么你不应该使用JavaScript加载它。浏览器将无法响应,直到数据加载。我会建议你只在浏览器中加载必要的数据(像一次20行)... –
我可以直接粘贴它,因此使用文件。它更多关于模块性,因为表数据文件被另一个程序修改。这不是一个巨大的数据量,即没有显着的不响应从浏览器 – Seb