0

I have a table like this:

<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>

But between the row of Peter Griffin, and Lois Griffin, I want make a line to separate them like this:

_____________________
[Firstname][Lastname]
---------------------
[   Peter ][Griffin]
--------------------- <---add a line here
[   Lois  ][Griffin]
---------------------
2
  • Are you wanting to do this server side or client side?
    – Tieson T.
    Aug 29, 2011 at 6:04
  • @Tieson, I think he's talking about a CSS issue, so I'm gonna guess client side.
    – nickf
    Aug 29, 2011 at 6:11

3 Answers 3

2

Should use CSS, something like this should work:

td { border-bottom: solid 1px #CCCCCC; }

Add padding if you want to space the words from the line a bit:

td { padding-top:5px; padding-bottom:5px; }
0

use css

table tr th, table tr td
{
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #666;
}
2
  • color will only effect text colour
    – Anil
    Aug 29, 2011 at 6:12
  • 1
    @JustAnil: the color property's main purpose is setting the text color, but in the absence of an explicit border-color (or auto), the value from color will be used.
    – tdammers
    Aug 29, 2011 at 6:20
-1
tr{ border-bottom: solid 1px #999; float: left; width: 100% }

then for cols (lets say u have 3 cols)

td{width: 30%; float: left; text-indent: 10px; border-right: solid 1px #999; overflow: hidden; padding: 1%;}

The reason for over flow is to hide text that are longer that the field

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.