Solved

ASP.net Table cell BorderStyle Bottom edge only

Posted on 2014-03-22
3
2,450 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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 …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
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.

760 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

21 Experts available now in Live!

Get 1:1 Help Now