Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I float two tables next to each other left to right?

Tags:

html

css

If I had two tables?

<table class="one"> and... <table class="two">

And the CSS looks like:

table.one {
    position: relative;
    float: left;
}
table.two {
    position: relative;
    float: right;
}

It is not working...

like image 534
Elias7 Avatar asked Apr 23 '12 04:04

Elias7


People also ask

How do I view two tables side by side in SQL?

SQL joins allow you to combine two datasets side-by-side, but UNION allows you to stack one dataset on top of the other. Put differently, UNION allows you to write two separate SELECT statements, and to have the results of one statement display in the same table as the results from the other statement.

How do you float a div left and right?

Use CSS property to set the height and width of div and use display property to place div in side-by-side format. float:left; This property is used for those elements(div) that will float on left side. float:right; This property is used for those elements(div) that will float on right side.


1 Answers

Don't use position:relative, just provide width for each table in order to float properly.

table.one {
    float:left;
    width:45%;
}

table.two   {
    width:45%;
    float:right;
}​
like image 57
irfanmcsd Avatar answered Oct 18 '22 19:10

irfanmcsd