# Why border-collapse doesn't work on th and td?



## Gdn8Melbourne (Oct 28, 2011)

```
table, th, td {border: 1px solid blue;}
table {border-collapse: collapse;}
```
This will collapse the table's border onto the th and td. Why not vice versa? i.e. Collapse th and td's border into table's? I tried

```
table, th, td {border: 1px solid blue;}
th, td {border-collapse: collapse;}
```
 but doesn't change anything.


----------



## brent.charlebois (May 8, 2007)

Would you explain further what you intend to do?


----------



## brent.charlebois (May 8, 2007)

Do you mean somthing like this?



```
table, th, td {border: 0px solid blue;}
table {border-collapse: collapse;}
```


----------



## brent.charlebois (May 8, 2007)

How About This?



```
<!DOCTYPE html>

<head>
<style>
table {
    border-collapse: collapse;
}

table, td, th {
    border: 1px solid black;
}
</style>
</head>

<body>

<h2>Let the borders collapse:</h2>

<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>
</table>

</body>

</html>
```

This is from :W3schools.comhttp://www.w3schools.com


----------



## Gdn8Melbourne (Oct 28, 2011)

BrentC said:


> How About This?
> 
> 
> 
> ...


No man. I get that border-collapse only works on table. It collapses table's border upon the th and td. I was wondering if we use the border-collapse on td, th, then why it doesn't collapse the border on table. I guess that is because th and td are child element of table and can't collapse their properties on table, but table can because table is parent.


----------



## brent.charlebois (May 8, 2007)

How about this...


```
<style>

table {border: 1px solid blue; border-collapse: collapse;}

</style>
```


----------

