Hi Mehram,
You need to take header template in order to display single header instead of repeating.
Please refer below sample.
HTML
<div class="box body table-responsive">
<asp:DataList ID="dlFabric" runat="server" RepeatDirection="Horizontal" RepeatColumns="3"
CellSpacing="20" CellPadding="2" RepeatLayout="Table" DataKeyField="articalno"
BorderWidth="10" GridLines="Both" BackColor="Window">
<HeaderTemplate>
<table class="table table-responsive" border="1">
<tr id="Tr1" runat="server" style="">
<th id="Th1" runat="server">
S. #
</th>
<th id="Th2" runat="server">
Artical #
</th>
<th id="Th3" runat="server">
Stock Qty
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblSNo" runat="server" Text='<%# Eval("row_num")%>' />
</td>
<td>
<asp:Label ID="lblArticalNo" runat="server" Text='<%# Eval("articalno")%>' />
</td>
<td>
<asp:Label ID="lblBalanceQty" runat="server" Text='<%# Eval("BalanceQty")%>' />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:DataList>
</div>
Namespace
C#
using System.Data;
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] {
new DataColumn("row_num", typeof(int)),
new DataColumn("articalno"),
new DataColumn("BalanceQty") });
dt.Rows.Add(1, "1441", "1234");
dt.Rows.Add(2, "1567", "1896");
dt.Rows.Add(3, "1571", "1347");
dt.Rows.Add(4, "1231", "1977");
dlFabric.DataSource = dt;
dlFabric.DataBind();
}
}
Screenshot