alt text

Hi i am facing issue with css. This is my css class applied to outer tabel it works fine but it apply to inner table also. This issue occurs in all browser.

Table.GridOne {
    padding:3px;
    margin:0;
    background:lightyellow;
    border-collapse: collapse;
}
Table.GridOne td {
    padding:3px 2px 5px 2px;
    border:1px solid #ff9900;
    border-collapse: collapse;
}
Table.GridOne Th {
    padding:5px;
    font-weight:bold;
    white-space:nowrap
}

2 answers

o.k.w 2355
2
points

Have another css style to hide the inner table cell border:

Table.GridOne table td {
    border: none;
}
Answered almost 7 years ago by o.k.w
0
points

The CSS you've declared states that it will apply to ALL table tags with the class GridOne. The second and third selectors will match all tds and ths within all matches for table.GridOne.

The quickest solution to this problem is to remove the GridOne class from your inner table. If you need that class to remain, then you can override the rules you've already declared by adding rules like o.k.w. suggested.

His suggested selector of table.GridOne table td will only match tds that are inside of a table that is already inside table.GridOne.

The W3C's chapter on Selectors in the CSS2 spec is a great resource! http://www.w3.org/TR/CSS2/selector.html

Answered almost 7 years ago by Scott Cranfill