Solved

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

Posted on 2014-03-30
3
429 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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