border around table

I cant place a border around a table row in asp.net .
I have tried a few variations but i can do border around a <td> but not <tr>


.tbmyprod1 tr
{
border:1px solid black;
 
}
   <table  class="tbmyprod1">
   
        <asp:ListView ID="lvCatalog" runat="server">
            <LayoutTemplate>
                <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
            </LayoutTemplate>

           
            <ItemTemplate>
             <tr >
               
                  <nopcommerce:productbox2 id="ctrlProductBox" product='<%# Container.DataItem %>'  runat="server" />
              <tr >         
           
            </ItemTemplate>
           
        </asp:ListView>
   
   </table>
jagguyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

John ClaesSenior .Net Consultant & Technical AnalistCommented:
upon the TR you indeed can't set the border, but you can set the borders of the TD's inside the TR
You probably don't want to see the vertical borders inside the row between fields

that is doable using the Styles
http://www.w3schools.com/css/css_border.asp
using the indiviual sides
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;

hope to be clear
0
Dave BaldwinFixer of ProblemsCommented:
You're right, you can't.  A <tr> has no content of it's own to put a border around.
0
Chris WalshSoftware DeveloperCommented:
Try:
.tbmyprod1 table
{
    border:1px solid black;
}
instead.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

khan_webguruCommented:
Also in your code you are not properly closing <tr> too.

Code it properly to avoid any unexpected results

<tr > //starting

</tr> //Ending
0
khan_webguruCommented:
for tr border try to use this

 
.tbmyprod1 tr { 
display:block; 
border:1px solid black; 
}

Open in new window

0
jagguyAuthor Commented:
In this example I cant place a bottom border around the 2nd element but i can around the 1st element of a row if there is an odd number of elements to display.

    <table>
    <!--<div class="product-grid">-->
        <asp:DataList ID="dlProducts" runat="server" RepeatColumns="2"
            RepeatLayout="Table" >
            <ItemTemplate>
         
          <nopCommerce:ProductBox1 ID="ctrlProductBox" Product='<%# Container.DataItem %>' runat="server" />
         
            </ItemTemplate>
        </asp:DataList>
   <!-- </div>    -->
 
   </table>

..

   <td class="myproduct">
   
        <asp:HyperLink ID="hlImageLink" runat="server" />
   
 </td>
0
jagguyAuthor Commented:
also this didnt work

.tbmyprod1 tr {
display:block;
border:1px solid black;
}

------------------------------
This place a border around the cell but leaves a gap so i dont get a straight border around all cells.

.myproduct-prodLine1a
{
    border-top :1px solid black;
border-bottom :1px solid black;
border-left :1px solid black;
}

.myproduct-prodLine1b
{
    border-top :1px solid black;
border-bottom :1px solid black;

}

.myproduct-prodLine1c
{
    border-top :1px solid black;
border-bottom :1px solid black;
border-right :1px solid black;
}


 <td class="myproduct-prodLine1a">
   
        <asp:HyperLink ID="hlImageLink" runat="server" />
  </td>
  <td class="myproduct-prodLine1b" >
        <asp:HyperLink ID="hlProduct" runat="server" />
 
        <asp:Literal runat="server" ID="lShortDescription"></asp:Literal>
   
   </td>
0
khan_webguruCommented:
where are TR is above code???
0
jagguyAuthor Commented:
tr is in another file that calls the td.

anyway i solved the datalist as i needed to use the styling in the control to make it work

 <asp:DataList ID="dlProducts" runat="server" RepeatColumns="2" RepeatLayout="Table"
         BorderWidth="1px" BorderColor="black" GridLines="Horizontal"  >

i might close this thread and start another on another control
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jagguyAuthor Commented:
need to redo question
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.