Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.net VB.net Table border lines appearing when none set

Posted on 2014-03-30
3
Medium Priority
?
442 Views
Last Modified: 2014-03-30
Hi
The code below dynamically adds the following table to my ASP.net web age.
I have deliberately tried to add no border lines but there are lines appearing
What is causing this? How do I stop it?

1
    Function oTableReport() As Table
        Try

            Dim rowCnt As Integer
            ' Current row count
            Dim rowCtr As Integer
            ' Total number of cells (columns).
            Dim cellCtr As Integer
            ' Current cell counter.
            Dim cellCnt As Integer
            Dim Table1 As New Table
            rowCnt = 2
            cellCnt = 3

            Table1.GridLines = GridLines.None

            For rowCtr = 1 To rowCnt
                Dim tRow As New TableRow()
                tRow.BackColor = Drawing.Color.Aqua
 
                For cellCtr = 1 To cellCnt
                    Dim tCell As New TableCell()
                    tCell.Text = "Row " & rowCtr & ", Cell " & cellCtr
                    tCell.BackColor = Drawing.Color.Aqua
                    'tCell.ForeColor = Drawing.Color.Blue
                    ' Add new TableCell object to row.
                    tRow.Cells.Add(tCell)
                Next
                ' Add new row to table.
                Table1.Rows.Add(tRow)
            Next
            Return Table1
        Catch ex As Exception
            MsgBox(ex.Message & " rew33")
        End Try
    End Function
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 39965644
Is there any default style for tables in your site or specific CSS rules applied to this table?

The CSS border-spacing could be one of the rules.
Note: To determine what rules are applied to your table, run developer tools (Press F12) on your IE browser.
0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 2000 total points
ID: 39965725
Hi murbro,
you can apply inline styles to the  dynamically created table:
Table1.BorderStyle = BorderStyle.None
tRow.BorderStyle = BorderStyle.None
tCell.BorderStyle = BorderStyle.None
' etc...

Open in new window

Or you could apply a generic table style in the head of the page
<style type="text/css">
    table {
      border: none; /* this should be enough */
    }
      table tr {
        border: none;
      }
      table td {
        border: none;
      }
  </style>

Open in new window

Respectfully yours,
Alan
0
 

Author Closing Comment

by:Murray Brown
ID: 39965809
Thanks
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question