# Display two columns using fixed width divs

**URL:** <https://www.ruby-forum.com/t/display-two-columns-using-fixed-width-divs/62780>\
**Category:** Rails\
**Created:** [June 8, 2006, 12:48am UTC](https://www.ruby-forum.com/t/display-two-columns-using-fixed-width-divs/62780 "2006-06-08T00:48:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e47c2d/32.png) [@Claus\_G](https://www.ruby-forum.com/u/Claus_G)\
**Post date:** [June 8, 2006, 12:48am UTC](https://www.ruby-forum.com/t/display-two-columns-using-fixed-width-divs/62780/1 "2006-06-08T00:48:33Z")

</div>

Hi.

I want to display some related information in two columns. Originally  
I wanted to use frames and googling led me to  
[http://lists.rubyonrails.org/pipermail/rails/2006-May/037972.html](http://lists.rubyonrails.org/pipermail/rails/2006-May/037972.html)  
which suggest divs instead.

I modified my code to this:

 \<%= render :partial =\> "col1" %\>

 \<%= render :partial =\> "col2" %\>

But col2 is placed below col1, not next to each other. I tried to add

- (minus) to -%\> in col1 but it did not make any difference.

\_col1.rhtml and \_col2 are link\_to\_remote ajax-calls.

regards  
Claus

---

<div class="post-metadata">

**Author:** ![Claus\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e47c2d/32.png) [@Claus\_G](https://www.ruby-forum.com/u/Claus_G)\
**Post date:** [June 8, 2006, 1:10am UTC](https://www.ruby-forum.com/t/display-two-columns-using-fixed-width-divs/62780/2 "2006-06-08T01:10:10Z")

</div>

I think you will need to add a float attribute to both divs for them  
to be positioned alongside each other.  
It depends on how you want them to look, but you could have them both  
float to the left or right, or one to the left and one to the right.

Just remember that the next html object needs to clear both floats.

This may be useful to you.  
[http://css.maxdesign.com.au/floatutorial/tutorial0801.htm](http://css.maxdesign.com.au/floatutorial/tutorial0801.htm)

will clark // graphic design  
[www.willclarkdesigns.com/](http://www.willclarkdesigns.com/)

removed\_email\_address@domain.invalid  
559 | 584 6785  
559 | 380 2731 [facsimile]

---

<div class="post-metadata">

**Author:** ![Claus\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e47c2d/32.png) [@Claus\_G](https://www.ruby-forum.com/u/Claus_G)\
**Post date:** [June 8, 2006, 9:47pm UTC](https://www.ruby-forum.com/t/display-two-columns-using-fixed-width-divs/62780/3 "2006-06-08T21:47:46Z")

</div>

> I think you will need to add a float attribute to both divs for them to be  
> positioned alongside each other.  
> It depends on how you want them to look, but you could have them both float  
> to the left or right, or one to the left and one to the right.
> 
> Just remember that the next html object needs to clear both floats.
> 
> This may be useful to you.  
> [Floatutorial: Tutorial 8 - Step 1](http://css.maxdesign.com.au/floatutorial/tutorial0801.htm)

Thank you! The link is very usefull. Works like a charm now 🙂

regards  
Claus
