DNB5brims
DNB5brims

Reputation: 30578

How to add a line in a table?

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]
---------------------

Upvotes: 0

Views: 443

Answers (3)

abayo oyewumi
abayo oyewumi

Reputation: 31

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

Upvotes: -1

sawan
sawan

Reputation: 2381

use css

table tr th, table tr td
{
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #666;
}

Upvotes: 0

Dmitry Samuylov
Dmitry Samuylov

Reputation: 1564

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; }

Upvotes: 2

Related Questions