When using gridview in vs2005, by default, the gridview control will add border-collapse:collapse to the style attribute in the generated html code;
The code copy is as follows:
<asp:GridView ID="GridView1" runat="server" BorderWidth="0"></asp:GridView>
The code in the page after the binding data is run is:
<table cellpacing="0" rules="all" id="GridView1" style="border-width:0px;border-collapse:collapse;"><tr><th scope="col">id</th><th scope="col">name</th></tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr></table>
The gridview control will automatically add: border-collapse: collapse;
To remove this automatically added code, just add CellSpacing="-1" and add the html code to
<table rules="all" id="GridView1" style="border-width:0px;"><tr><th scope="col">id</th><th scope="col">name</th></tr><tr><td>1</td><td>1</td></tr><tr><td>2</td><td>2</td></tr></table>
One more thing:
GridLines="None" does not display cell borders
CellSpacing="-1" Remove border-collapse:collapse; style in GridView style
Note: The problem encountered in the firefox browser, border merging causes some border lines to become thicker, GridLines="None" can solve it