Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify the bottom border of a <tr>?

Tags:

I tried :

.bb {
    border-bottom:1px;
}

<tr class="bb">

But no effect at all.

like image 377
omg Avatar asked Sep 06 '09 03:09

omg


People also ask

How do you set a border on TR?

Not directly: adding a border to a tr isn't allowed. But you can target the first and last cell, give those a left/right border respectively. Then on each cell put a top border and a bottom border on each td element.

How do I add a bottom border in TD?

Solution with the CSS border-bottom property If you want to add a border only to the bottom of the table row, you can apply the CSS border-bottom property to <td> elements that are placed within a <tr> tag.

Can TR element have border?

Borders can be added to rows of table by adding border to <td> and <th> elements [This is basically a CSS trick to achieve (hack!) that as borders cannot be added to <tr> and <tbody> elements of table]. Add following styles to your CSS to get borders around rows or headers or table cells.


1 Answers

Try the following instead:

<html>
 <head>
  <title>Table row styling</title>
  <style type="text/css">
    .bb td, .bb th {
     border-bottom: 1px solid black !important;
    }
  </style>
 </head>
 <body>
  <table>
    <tr class="bb">
      <td>This</td>
      <td>should</td>
      <td>work</td>
    </tr>
  </table>
 </body>
</html>
like image 116
David Andres Avatar answered Oct 06 '22 01:10

David Andres