Solved

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

Posted on 2014-03-30
3
425 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

12 Experts available now in Live!

Get 1:1 Help Now