views:

277

answers:

2

Hello, I want to create a html table with a 1pt black outer border and the same border around every td.

Should look like this (only the borders, of course)

link text

I use

<table border="1" style="border-collapse:collapse; border-color:Black; border-style:solid; border-width:1pt">

As a result I get a black outer, but grey inner borders.

A: 

You could try implement something like this in your CSS stylesheet.

.mytable
{
border-collapse:collapse; 
border-color:#000000; 
border-style:solid; 
border-width:2px;
}

.mytable td
{
border-color:#cccccc; /*grey*/
border-style:solid; 
border-width:1px;
}

And something like this HTML:

<table class="mytable">
    <tr>
        <td>Content</td>
    </tr>
</table>

Example here

Kyle Sevenoaks
The css selector should be table.mytable - without space - or just .mytable. Like it is now you are targeting a .mytable class inside a table.
easwee
Ah! thanks! Typos everywhere today :)
Kyle Sevenoaks
Great! I thought it would work without speaking to the td´s,but that seems not to be so.
Jan-Frederik Carl
A: 

It don't works with 1 Pixel Border outside :-(

Gernott