Solved

ASP.net Table cell BorderStyle Bottom edge only

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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