Click to See Complete Forum and Search --> : Help me with this table inheritance question...


Mindman
10-12-2006, 05:16 PM
This is quite frustrating. Below is my code for two separate tables, the first one is intended for use on my main table only, so it takes 80% of the width of the screen. The second one is for the tables inside the main table, which I want to take 100% of the width available to them.

The problem is that the "table.other" is inheriting the width from the "table" code, which makes them 80% wide not 100%. I don't want that at all. That would seem like an easy fix at first. Just create two different table classes, right? Nope. When I do that, the width doesn't have any effect at all.

What am I doing wrong here?? I just want to create two tables declarations without one inheriting from the other. Here's the code I've been using:

table {
width: 80%;
margin: 0;
margin-left: auto;
margin-right: auto;
padding: 0;
font-size: small;
}

table.other {
width: 100%;
margin: 0;
padding: 0;
font-size: small;
}

ray326
10-12-2006, 10:14 PM
The only difference is the width so why not just do it inline on the one where it's needed?

<table style="width:100%">...