html - HTML表格很大时响应时间慢
问题描述
当行数很大时,我的 HTML 表需要更多时间来加载。我必须将近 50000 行表加载到网页中。我只是使用了基本的 HTML 表格。ASP.NET C#。
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Available Resistors In Stock</h3>
<!--
<input type="text" class="form-control pull-right" id="task-table-filter" data-action="filter" data-filters="#task-table" placeholder="Filter Resistors" />
-->
</div>
<table class="table table-hover" id="task-table">
<thead>
<tr>
<th class="center">#</th>
<th class="center">Resistor Type</th>
<th class="center">Resistor Value</th>
<th class="center">Ohm</th>
<th class="center">Location</th>
<th class="center">PL</th>
<th class="center">Place</th>
<th class="center">Category</th>
<th class="center">Quantity</th>
<th class="center">Part NO</th>
<th class="center">Description</th>
<th class="center">Active</th>
<th class="center">Edit</th>
</tr>
</thead>
<tbody>
@for (int i = 0; i < Model.Rows.Count; i++)
{
<tr class="center">
<td>@Model.Rows[i][0]</td>
<td>@Model.Rows[i][1]</td>
<td>@Model.Rows[i][2]</td>
<td>@Model.Rows[i][3]</td>
<td>@Model.Rows[i][4]</td>
<td>@Model.Rows[i][5]</td>
<td>@Model.Rows[i][6]</td>
<td>@Model.Rows[i][7]</td>
<td>@Model.Rows[i][8]</td>
<td>@Model.Rows[i][9]</td>
<td>@Model.Rows[i][10]</td>
<td>@Model.Rows[i][11]</td>
<td>
<a href="@Url.Action("StoreAddResistors", "Store",new {@id=@Model.Rows[i][0] } )">
<span class="glyphicon glyphicon-refresh"></span>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
有什么办法可以减少网页的加载时间?
解决方案
尝试将页面分成几个。或者是否有可能以某种方式将多个 html 文档连接到 1 页?我没有更多的想法
推荐阅读
- pyspark - Pyspark user_agent 解析
- javascript - 在来自 Karma-JUnit-Reporter 的 JUnit xml 文件中包含文件名
- ios - Xcode 故事板显示所有孩子的约束
- ios - 一行中的连续声明必须用';
- angular - 将路径添加到 npm 包的 tsconfig.json 文件是否安全/可以?
- typescript - 域实体如何在 Clean Architecture 中相互引用
- python - 将抓取的二进制文件写入 blob,而无需先将其写入磁盘
- html - 添加 disply:swipe google font apis ip board
- c# - 通过 LINQ 语句和计算将记录添加到结果集中
- r - 如何从 R 中的另一个数据框中添加新列,对应于第一个数据框中的特定样本