Forum: Ruby on Rails display two columns using fixed width divs

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B8d11b4c89cfc6e34d6c9fb121c9acac?d=identicon&s=25 Claus Guttesen (Guest)
on 2006-06-08 00:48
(Received via mailing list)
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-...
which suggest divs instead.

I modified my code to this:

<body>
<div style='width: 300px; overflow: scroll'>
  <%= render :partial => "col1" %>
</div>

<div style='width: 300px; overflow: scroll'>
  <%= render :partial => "col2" %>
</div>
</body>

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
Fd17e0a67191e9e72df285e1b8e4c2fb?d=identicon&s=25 Will Clark (Guest)
on 2006-06-08 01:10
(Received via mailing list)
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/

will@willclarkdesigns.com
559 | 584 6785
559 | 380 2731 [ facsimile ]
B8d11b4c89cfc6e34d6c9fb121c9acac?d=identicon&s=25 Claus Guttesen (Guest)
on 2006-06-08 21:47
(Received via mailing list)
> 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 :-)

regards
Claus
This topic is locked and can not be replied to.