復制代碼 代碼如下:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" CssClass="tablecss">
<Columns>
<asp:TemplateField HeaderText="編號" HeaderStyle-CssClass="aaa" ItemStyle-CssClass="bbb">
<ItemTemplate>
<%#Eval("id") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="姓名" HeaderStyle-CssClass="aaa" ItemStyle-CssClass="bbb">
<ItemTemplate>
<%#Eval("name") %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
<div>
<table class="tablecss" cellspacing="0" rules="all" border="1" id="Table1" style="border-collapse: collapse;">
<tr>
<th class="aaa" scope="col">編號</th>
<th class="aaa" scope="col">姓名</th>
</tr>
<tr>
<td class="bbb">1</td>
<td class="bbb">張三</td>
</tr>
<tr>
<td class="bbb">2</td>
<td class="bbb">李四</td>
</tr>
</table>
</div>