Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Html Writers > creating tables...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 315 of 330
Post > Topic >>

creating tables within a for loop

by Dave Lynam <dlynam@[EMAIL PROTECTED] > Dec 24, 2007 at 10:28 AM

I am programming a website in ruby on rails and I am having a problem
aligning tables within a for loop.  I have a css element and within
that element a for loop in ruby.  The code is as seen below:
	<div id="friends">
		<table border=1>
			<% for user in @[EMAIL PROTECTED]
 -%>
					<td>
 	                                        <%= link_to
image_tag(user.avatar.public_filename(:tiny)) %>
					</td><tr>
					<td>
						<%= user.screen_name %>
					</td></tr>
			<% end %>
		</table>
	</div>

This produces avatar thumbnails with the user screen name below it
which is great, but the cells are lined up wrong.  They are lined up
vertically and after each loop it creates a new line so the avatars
are stacked on top of eachother.  I want to line these up horizontally
so that I can have rows of avatar links within the css block.  Does
anyone know how to do this?  Any help is greatly appreciated!  I am
totally stuck and have been working on this for days.  Thanks.




 1 Posts in Topic:
creating tables within a for loop
Dave Lynam <dlynam@[EM  2007-12-24 10:28:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 0:01:43 CDT 2008.