0

I am trying to get an asp.net table to show gridlines after an sql query is ran and data is put into the table. I have now tried to set a default title row to see if the gridlines would even appear and they have not.

Here is my table markup:

    <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>

So, how can I get grid lines to show on my asp.net table?

4
  • I forgot to add that I have tried using just vertical and just horizontal gridlines. In my example above, I use "both". Commented Jul 9, 2013 at 15:07
  • 1
    Why not use a GridView? Commented Jul 9, 2013 at 15:09
  • I've never used a GridView... Looks exactly like what I want. Thanks Garrison! Commented Jul 9, 2013 at 15:18
  • 1
    You'll love all of the built-in functionality the GridView provides. Good luck! Commented Jul 9, 2013 at 15:20

2 Answers 2

2

BorderColor property should make them visible. Since the background is white, try setting the the BorderColor to Black.

Sign up to request clarification or add additional context in comments.

3 Comments

Nothing changed when i changed borderColor to black. I also tried this with some borderStyles and different BackColors.
Hmm, it worked for me in VS 2010 before posting this. Looks like you found the GridView though! Good luck!
Not sure what was going on... Thanks, though!
1

You need to set Border=1 in your table tag.

1 Comment

Hey there, you're probably right, but this problem is 8 years old and I probably won't go back to verify this :p

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.