Solved

ASP.net Table cell BorderStyle Bottom edge only

Posted on 2014-03-22
3
3,021 Views
Last Modified: 2014-03-27
Hi

I am using the following VB.net code to set the border style of  a Table Cell in ASP.net to the Css Class shown further down. This affects all four borders of the cell. How do I only
affect the bottom border and leave the other three sides of the cell as blank or white.
I was shown an example of the xml code used to do this but I am dynamically building the table in VB.net

 Dim tCell As New TableCell()
 tCell.CssClass = "td"
  tRow.Cells.Add(tCell)

 td { border-bottom: double 2px black; }


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <style type="text/css">
        td.double-underline { border-bottom: double 2px black; }
    </style>
    <title></title>
</head>
<body>

    <form id="form1" runat="server">
    <div>
        <asp:Table>
            <asp:TableRow>
                <asp:TableCell CssClass="double-underline">Some content</asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </div>
    </form>

</body>
</html>
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 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 39948837
Note the difference between your initial line of css and the one in the code example:
td { border-bottom: double 2px black; }

Open in new window

works on all td's whereas
td.double-underline { border-bottom: double 2px black; }

Open in new window

defines a new class that only works on td's of that class.

So you should use the second one and then change the dynamic assignment in the code accordingly:
tCell.CssClass = "double-underline"

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39948848
I just tested it and it works as inline style but not as css class.
0
 

Author Closing Comment

by:Murray Brown
ID: 39959643
thanks
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

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 …
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

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