【发布时间】:2020-05-15 11:19:28
【问题描述】:
我创建的表格上方有一个未知的空白。当我检查代码时,有
和 's 但我从未使用过它们。会不会是因为我不使用 tbody 和 thead 而出现的?当我删除检查中的所有中断和跨度时,它是正确的。
<div class="container" style="overflow:auto">
<table class="table table-striped">
<tr>
<th scope="col"></th>
<th scope="col">Product</th>
<th scope="col">Voorraad</th>
<th scope="col" class="text-center">Aantal</th>
<th scope="col" class="text-right">Prijs</th>
<th scope="col"></th>
</tr>
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:webshopConnectionString %>" providername="<%$ ConnectionStrings:webshopConnectionString.ProviderName %>" selectcommand="SELECT tblbestelling.Aantal, tblproducten.ProductID, tblproducten.ProductNaam, tblproducten.ProductAfbeelding, tblproducten.ProductPrijs, tblproducten.ProductVoorraad FROM tblbestelling INNER JOIN tblproducten ON tblbestelling.ProductID = tblproducten.ProductID"></asp:sqldatasource>
<asp:Datalist runat="server" datakeyfield="ProductID" datasourceid="SqlDataSource1" repeatlayout="Flow">
<ItemTemplate>
<tr>
<td>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ProductAfbeelding", "~/imgs/{0}") %>' style="height:50px; width:50px" />
</td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("ProductNaam") %>'></asp:Label>
</td>
<td>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductVoorraad") %>'></asp:Label>
</td>
<td>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Aantal") %>'></asp:Label>
</td>
<td>
<asp:Label ID="Label4" runat="server"></asp:Label>
</td>
<td>
<asp:LinkButton ID="Button1" runat="server" CssClass="text-danger" Text="Button"><i class='fa fa-trash'></i></asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:Datalist>
</table>
</div>
【问题讨论】:
-
你能发一张问题的图片吗?
-
已编辑 - 我做了。
-
您检查过桌子上的“检查”选项吗?因为可能这个表上有一个style有影响,也可能和asp.net无关
-
还有容器和表格的 CSS 代码......
-
我添加了一张图片!