Display two columns using fixed width divs


#1

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
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


#2

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

will clark // graphic design
www.willclarkdesigns.com/

removed_email_address@domain.invalid
559 | 584 6785
559 | 380 2731 [ facsimile ]


#3

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

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

regards
Claus