我不太确定。我有一个由 2 个 foreach 循环(2 个报告)组成的表,并将每一行呈现在<tr>
在报告的数据之间我想插入一个开放的行来拆分数据,更容易阅读,我插入了一个空的<tr>
,但这似乎不起作用。我也试过</ br>
并得到警告。
我知道普通的 html 和 php..这有什么不同吗?
我的观点.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Report/Report.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<TradeUK.Entities.Reporting.KPIResults>>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
TradeUK KPI Searches Data
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>TradeUK KPI Searches Data</h2>
<p>
<%: Html.ActionLink("Export as CSV...", "TradeUKKPIDataExport", "Report", new { @date = ViewBag.jobSortedReportDate}, null )%>
</p>
<table>
<tr>
<th style="width: 400px;">
Title
</th>
<th style="width: 150px;">
Total
</th>
<th style="width: 150px;">
Week 6
</th>
<th style="width: 150px;">
Week 5
</th>
<th style="width: 150px;">
Week 4
</th>
<th style="width: 150px;">
Week 3
</th>
<th style="width: 150px;">
Week 2
</th>
<th style="width: 150px;">
Week 1
</th>
</tr>
<% foreach (var item in Model)
{
%>
<tr>
<td>
<%: item.Title%>
</td>
<td>
<%: item.Total%>
</td>
<td>
<%: item.Week6%>
</td>
<td>
<%: item.Week5%>
</td>
<td>
<%: item.Week4%>
</td>
<td>
<%: item.Week3%>
</td>
<td>
<%: item.Week2%>
</td>
<td>
<%: item.Week1%>
</td>
</tr>
<%} %>
<tr></tr><tr></tr><tr></tr>
<tr>
<th style="width: 400px;">
Title
</th>
<th style="width: 150px;">
Total
</th>
<th style="width: 150px;">
Week 6
</th>
<th style="width: 150px;">
Week 5
</th>
<th style="width: 150px;">
Week 4
</th>
<th style="width: 150px;">
Week 3
</th>
<th style="width: 150px;">
Week 2
</th>
<th style="width: 150px;">
Week 1
</th>
</tr>
<% foreach (var item2 in ViewBag.jobSortedModel)
{
%>
<tr>
<td>
<%: item2.Title %>
</td>
<td>
<%: item2.Total %>
</td>
<td>
<%: item2.Week6 %>
</td>
<td>
<%: item2.Week5 %>
</td>
<td>
<%: item2.Week4 %>
</td>
<td>
<%: item2.Week3 %>
</td>
<td>
<%: item2.Week2 %>
</td>
<td>
<%: item2.Week1 %>
</td>
</tr>
<%
} %>
</table>
</asp:Content>
我不太明白?