tags:

views:

48

answers:

2

Can you look at table 7 in this page? http://www.gpahesapla.com/index.php?/functions/calculator

why does table 7 not float on left? It floats on left if i add a row in table 6. There should be two tables in a row always.

(To see tables plz select school: duglus; Faculty: Engneering; Department: Electronics

Moreover if anyone want to comment on GPA Box. It does not work in IE8 (may be fixed property does not work in IE8)

+2  A: 

Table 5 is floated left, and Table 6 is shorter than Table 5. So this leaves a little bit of room for Table 7 to squeeze below Table 6. To fix this, just make sure to clear the float on your odd-numbered tables....

#table1, #table3, #table5, #table7 {
  clear: left;
}

A cleaner, more dynamic selector would use the nth-child pseudo-selector in combination with odd, but be aware this is part of CSS3 and therefore will not be fully supported by older browsers...

#tables table:nth-child(odd) {
  clear: left;
}
Josh Stodola
@Josh Stodola: Do you not mean `table:nth-child(odd)`? As far as I am aware `#tables` will not work. But feel free to correct me if I am wrong.
ClarkeyBoy
Ok nevermind that comment - I see what you mean now... #tables being the container for all the tables... I've seen the light (or should I say code) now.
ClarkeyBoy
@ClarkeyBoy Actually, you are correct. I've updated the answer.
Josh Stodola
Ah cool... I did wonder why it was I had always used tr:nth-child(odd) for alternate rows. Thought I may not be remembering it correctly though.
ClarkeyBoy
thanks josh..i m falling in love with stackoverflow now..
mysterious
@mysterious Good! It's a great place to expand your knowledge.
Josh Stodola
A: 

I cannot see the code - on view source it displays the code for the original page, before selecting any options. However I suspect that you do not have a div with clear: both after each "row" of tables. i.e. for every layer of tables, you need to have the aforementioned div.

I also suggest, to make it simpler to read, that you apply a class to each table instead of specifying #table th, #table2 th etc and then specify the following:

.className th|tr|td etc {
    properties;
}

If you dont get what I mean then please say so and I will expand on it some more.

ClarkeyBoy
"I cannot see the code" You need a developer toolbar! Chrome and IE both have one built-in.
Josh Stodola
Ah yeah I see what you mean now - I forgot about that for a moment, even though I was only using it 10 minutes ago...
ClarkeyBoy