Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Floating and clearing tables

Posted on 2014-01-18
8
Medium Priority
?
219 Views
Last Modified: 2014-01-18
Hello

I need to clarify the use of clear.

I have two tables on a page.  I want them both to float left.

The first table on the page I have given this id:  TableFloatLeft  
and its css is

Table#TableFloatLeft;
float:left;
}

I have another table on the page that I want to have directly below it.

I haven't given it an ID yet or any css.  Waiting for your response here.

From what I have googled, at some place I need to insert a clear.  But I am not sure where I add the clear.

I have a feeling I add it to the css of the second table.

In my next comment I will give you a link to the page, work in progress.

Thanks!
0
Comment
Question by:Rowby Goren
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 9

Author Comment

by:Rowby Goren
ID: 39790976
Here's the link to the page.  You'll see a bunch of <p>&nbsp;</p>'s in the source. They are only there temporarily to give you an idea of what I want the page to look like with the <p>&nbsp;</p>'s

Thanks

Link to test site
0
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 2000 total points
ID: 39791012
There is no CSS in your page to float the table left and I can't see a reason why you'd need it. Forget about the floats on the tables and they'll just drop under one another by default - no need to mess with it.

You do have an align="left" attribute on both your tables which not supported in HTML5, so remove that and all will be well :)
0
 
LVL 58

Expert Comment

by:Gary
ID: 39791016
With bootstrap you can add a class of clearfix to the second table.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 58

Expert Comment

by:Gary
ID: 39791038
Wrap your first table in
<div class="row">
...
</div>
0
 
LVL 9

Author Comment

by:Rowby Goren
ID: 39791078
Hi

Removing align left worked fine.  The tables are now stacked as needed.  

However I am wondering what any additional advantage would be using Cathal's suggestions. Since this is using twitter bootstrap.

I will be splitting points so perhaps we can have a brief discussion on the advantages of adding  the class "row" /  clearfix to the second

I will be using the page as a template for others to use on this site, so I would like to optimize the layout as well as I can.

However, as I said, just removing the align left seems to fix it

AND the image table rearrange themselves reasonably well  on a cell phone. I assume that is thanks to twitter bootstrap?

Link to test page

Rowby
0
 
LVL 58

Expert Comment

by:Gary
ID: 39791083
The .row is just using Bootstrap to declare the div takes up all the width.
Don't split points - Chris was spot on, I missed the link initially.
0
 
LVL 44

Expert Comment

by:Chris Stanyon
ID: 39791097
The formatting you have has nothing to do with bootstrap - just left to it's own devices it will work as you expect. The images realigning themselves is default behaviour - if there's not enough room on the line they'll drop to the next (now that you've removed the table!)

There is no advantage in adding a .row wrapper DIV - a table is a block level element by default, so wrapping one block in another serves no purpose in your case
0
 
LVL 9

Author Closing Comment

by:Rowby Goren
ID: 39791151
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question