Many beginners are curious about what the GridView generated HTML code is, and here's a sample comparison that you can refer to in the following
Code as follows: <asp:gridview id= "GridView1" runat= "Server" autogeneratecolumns= "false" cssclass= "Tablecss" > <Columns> <asp:templatefield headertext= "number" headerstyle-cssclass= "AAA" itemstyle-cssclass= " BBB "> <ItemTemplate> <% #Eval (" id ")%> </ItemTemplate> </asp: templatefield> <asp:templatefield headertext= "name" 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" Border-collapse:collapse; " > <tr> <th class= "aaa" scope= "col" > Number </th> <th class= "aaa" scope= "col" > Name </TH>&NBSp </tr> <tr> <td class= "BBB" >1</td> <td class= "BBB" > John </td> </tr> <tr> <td class= "BBB" >2</td> <td class= "bbb" > Dick </td > </tr> </table> </div>