How to make two charts using highchart show up in the same line side by side using div

Question!

I want to display two charts in the same line using div. Can you please help?

Here is the what I am trying but it shows up in 2 lines.

<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
    <div>
        <div id="container" style="width: 200px; height: 200px; diplay:inline"></div>
        <div id="container2" style="width: 200px; height: 200px; display:inline"></div>

    </div>

full code in http://jsfiddle.net/nCe36/



Answers
Just float the containers left!

Either give both #container and #container2 a left float:

#container,
#container2 {
    float: left;
}

(Demo)

Or give both containers a class (say, "container") and float that class left:

.container {
    float: left;
}

(Demo)

Edit: display: inline-block will also work, as @Nile has pointed out. It's a matter of personal preference: I tend to prefer floats; some people, inline-blocks. For more information on which to use, you might want to check out this post: float:left; vs display:inline; vs display:inline-block; vs display:table-cell;.



Try:

display: inline-block;

Modified example: http://jsfiddle.net/pzqLG/

By : Nile


This video can help you solving your question :)
By: admin