Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2001, 05:27 PM
fandango fandango is offline
Guest
 
Join Date: Jun 2001
Location: Oregano
Posts: 411
Let's see if I can explain this clearly:

I am dynamically generating web pages. These web pages have groups of images that I want to put in a particualar format (i.e., a group of 4 or five images side-by-side.)
So think of these groups as "words". When I reach the end of a browser window, I want the groups of images to "word wrap", that is, continue on the next line, but not break up any single group of images. Clear? Now, I've tried using <pre> and <table>, but when two consecutive <pre> or <tables> are used (in IE), it puts the second below the first. I want to conserve space and put as many groups on one line as possible.

Any one know a good way to do this?
  #2  
Old 08-05-2001, 06:01 PM
ThwartedEfforts ThwartedEfforts is offline
Guest
 
Join Date: Aug 2001
Location: Chicago
Posts: 3
Quote:
Originally posted by fandango


Clear? Now, I've tried using <pre> and <table>, but when two consecutive <pre> or <tables> are used (in IE), it puts the second below the first. I want to conserve space and put as many groups on one line as possible.



Any one know a good way to do this?
What you want to do is explictly tell the browser were it can break lines. Do not put any extra spaces or break lines in your HTML where you don't want them to happen, that is, each tag must be butted right up next to the next tag. That said, do this to make groups of three

<img>&nsbp;<img>&nbsp;<img> <img>&nsbp;<img>&nbsp;<img>

The &nsbp; is a "non breaking space", the browser is not susposed to wrap based on those spaces. The only place the browser can wrap is at the space (or you could put two two sets on different lines, because the end of line is equal to a space) in between to two sets.
Note that the ampersand and semicolon are important.

If the images can fit six across, with the above example, then it shouldn't break up, but if it can't fit six, then it should two rows of three.

Other than that, you could try nested tables, but remember that if you nest tables, closing </TR> tags and </TD> tags are required for all rows and datas.

(if any admins are reading this, the &nbsp; tags randomly disappear in my editing body when I preview .. this may be a limit of my browser though).
  #3  
Old 08-05-2001, 06:48 PM
fandango fandango is offline
Guest
 
Join Date: Jun 2001
Location: Oregano
Posts: 411
Quote:
Originally posted by ThwartedEfforts
Quote:
Originally posted by fandango


Any one know a good way to do this?




What you want to do is explictly tell the browser were it can break lines. Do not put any extra spaces or break lines in your HTML where you don't want them to happen, that is, each tag must be butted right up next to the next tag. That said, do this to make groups of three





<img>&nsbp;<img>&nbsp;<img> <img>&nsbp;<img>&nbsp;<img>



If the images can fit six across, with the above example, then it shouldn't break up, but if it can't fit six, then it should two rows of three.
It should, but it doesn't...at least with IE.

Quote:
Other than that, you could try nested tables, but remember that if you nest tables, closing </TR> tags and </TD> tags are required for all rows and datas.
Right, but since I don't know where to break the rows--because that would be based on the user's screen width, I wouldn't be able to tell where to insert the <TR> tags.
  #4  
Old 08-05-2001, 07:48 PM
yabob yabob is offline
Charter Member
 
Join Date: Mar 2000
Posts: 7,880
Try the <NOBR> tag. This is supposed to specify no breaks for the enclosed content, so something like:

<NOBR><IMG><IMG><IMG></NOBR><NOBR><IMG><IMG></NOBR>

should give you what you want. It's usually used to group text - I'm not sure how it interacts with images.
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:08 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.

Send questions for Cecil Adams to: cecil@straightdope.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Copyright 2018 STM Reader, LLC.

 
Copyright © 2017