?
Solved

Floating and clearing tables

Posted on 2014-01-18
8
Medium Priority
?
215 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 43

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
Independent Software Vendors: 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 43

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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 style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses

765 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