我正在尝试获取一个asp.net表,以便在运行sql查询并将数据放入表中后显示网格线。我现在尝试设置一个默认的标题行,看看网格线是否会出现,但它们没有。
这是我的表格标记:
<asp:Table ID="Table1" runat="server" ForeColor="Black" GridLines="Both" Height="330px" Width="950px">
<asp:TableRow runat="server" BackColor="White" BorderColor="White" BorderStyle="Solid" BorderWidth="5px" Font-Bold="True" Font-Size="X-Small" ForeColor="#993399" HorizontalAlign="Center" VerticalAlign="Top">
<asp:TableCell runat="server">Customer ID</asp:TableCell>
<asp:TableCell runat="server">Business Name</asp:TableCell>
<asp:TableCell runat="server">City</asp:TableCell>
<asp:TableCell runat="server">State</asp:TableCell>
<asp:TableCell runat="server">Phone</asp:TableCell>
<asp:TableCell runat="server">Email</asp:TableCell>
<asp:TableCell runat="server">Registered</asp:TableCell>
<asp:TableCell runat="server">Approved</asp:TableCell>
<asp:TableCell runat="server">Last Contacted</asp:TableCell>
<asp:TableCell runat="server">Logger</asp:TableCell>
<asp:TableCell runat="server">Responded</asp:TableCell>
</asp:TableRow>
那么,如何在我的asp.net表格中显示网格线?
答案 0 :(得分:2)
BorderColor属性应该使它们可见。由于背景为白色,请尝试将BorderColor设置为黑色。
答案 1 :(得分:1)
您需要在表格标签中设置 Border=1。