Solved

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

Posted on 2014-03-30
3
428 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:murbro
3 Comments
 
LVL 35

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 500 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:murbro
ID: 39965809
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now