cpowel2
cpowel2

Reputation: 605

CSS formatting not working for table borders

I was wondering if someone could help me with a CSS related question. The dilemma I am having is that I would like to create a css i guess they are called "classes" for lack of a better word I really don't know what to call them. But the problem I am having is that for some reason it will only display the borders around one of the tables in my form ill post the code I used to create the tables attributes maybe you can tell me where I am going wrong

table.paddedTable table
{
    border-collapse: collapse;
    padding-bottom:2px;                    
    border-style: solid;
    border-color: black;
    border-width: 3px;
    height: 100px;
}

In the table part I am using <table class = "paddedTable">

Upvotes: 1

Views: 6243

Answers (2)

Brian Hoover
Brian Hoover

Reputation: 7991

This would set the borders of any tables contained in a table with class paddedTable.

I think what you want is just:

 table.paddedTable  {
border-collapse: collapse;
padding-bottom:2px;                    
border-style: solid;
border-color: black;
border-width: 3px;
height: 100px;
 }

However, it would help to see the code in action.

Upvotes: 1

Blender
Blender

Reputation: 298176

Your code only applies to tables within tables. Try re-writing your selector:

 table.paddedTable
 {
border-collapse: collapse;
padding-bottom:2px;                    
border-style: solid;
border-color: black;
border-width: 3px;
height: 100px;
 }

Upvotes: 1

Related Questions