Solved

ASP.net Table cell BorderStyle Bottom edge only

Posted on 2014-03-22
3
2,605 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:murbro
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:murbro
ID: 39959643
thanks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

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