Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table with black outer, but grey inner border

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)

enter image description here

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.

like image 690
AGuyCalledGerald Avatar asked Apr 16 '10 12:04

AGuyCalledGerald


People also ask

Can you set specific colors for table borders?

With the border-color property, you can set the color of the border.

What 3 types of border styles can a table have?

border-bottom-style. border-left-style. border-right-style.

How do you change the outside border on a table?

Go to Table Tools >Design > Table Styles > Borders, and then click the border option that you want to change.

How do I make a table border transparent?

Right-click the table, and then click Format Table. In the Format Table dialog box, under Fill, move the Transparency slider to get the percentage of transparency you want.


1 Answers

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

like image 173
Kyle Avatar answered Sep 22 '22 11:09

Kyle