我正在编写一个页面,我需要一个HTML表来维护一个设置的大小.我需要表格顶部的标题始终保持在那里,但无论表格中添加了多少行,我还需要滚动表格的主体.想想一个迷你版的excel.这似乎是一项简单的任务,但我在网上找到的几乎所有解决方案都有一些缺点.我怎么解决这个问题?
我在JavaScript的帮助下呈现HTML表。我已经成功地制作了表格,但是现在我有一个要求可以连续显示一些新数据,例如单击“展开”行
表功能:
在我的代码中,我注释了所有行,我在那一行中正在做什么
我面临的问题
tbody作为GRN entery品牌的睿智但造成问题的我创建了两个代码段,一个是完整的静态HTML,就像我想要的那样,另一个是显示我的工作。
我在Google上找到的帮助
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css">
<table class="table table-responsive table-hover table-bordered">
<thead>
<tr>
<th> Brand Name</th>
<th colspan="2">Total</th>
<th colspan="2">Jayanagar</th>
<th colspan="2">Malleshwaram</th>
<th colspan="2">Kolar</th>
</tr>
<tr>
<th></th>
<th>Grn Entery</th>
<th>Sales</th>
<th>Grn Entery</th>
<th>Sales</th>
<th>Grn Entery</th>
<th>Sales</th>
<th>Grn Entery</th>
<th>Sales</th>
</tr>
<tr>
<th>Total</th>
<th>1,97,445</th>
<th>6,83,880</th>
<th>1,97,445</th>
<th>4,76,426</th>
<th>0</th>
<th>1,15,313</th>
<th>0</th>
<th>92,141</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="clickable" data-toggle="collapse" id="row1" …Run Code Online (Sandbox Code Playgroud)