PDA

View Full Version : <HTML> Random TABLE sizes?



slim150
07-02-2007, 09:41 PM
Is there an easy (non-manual way) to come up with an HTML table that has variable sized rows and columns.

The point of this is I want to have a page on my website that is like a photo colloage.. but rather them all being the same boring size i want them to be different sizes and stuff.

The page would expand as I get more pictures so it would be a pain to have to do manually.

any suggestions?

SaveFerris
07-02-2007, 10:55 PM
You can just not set the size of the table, then it will stretch to whatever the size of the photo is.

I think what you mean is a way to make the pictures random sizes as opposed to the table. Because changing the size of the table will not affect the pictures, the table will either stretch or cause the picture to be hidden behind one of the cells. Anyway it wouldn't be hard to achieve random image sizes using PHP, an example would be to get PHP to check the dimensions for an image, come up with a random number then make the images grow or shrink dependant of that particular random number (this way images stay with the same ratio so they look better). Then you could repeat the method for every image and each one would have a random size, this may cause the table to look fucked up if on the same row some images were very large and some very small.

slim150
07-03-2007, 12:27 AM
interesting.. prehaps if i use a random number for one side and then scale it to the other.. thus keeping the proportions .... thanks!

SaveFerris
07-03-2007, 12:41 AM
interesting.. prehaps if i use a random number for one side and then scale it to the other.. thus keeping the proportions .... thanks!

Indeed, that is what I meant.

slim150
07-03-2007, 02:22 AM
altho i will probably just put it all in photoshop, resize it myself and export as one giant jpg. =D

Barbarossa
07-03-2007, 09:08 AM
^ I don't like that idea.

The more usual way is to have a "menu" page containing photo thumbnails, and then you click to see the full-sized photo.

You could actually do that with a single huge image, by defining maps, but it's alot of work. ;)

slim150
07-03-2007, 03:51 PM
maps you say?

Barbarossa
07-03-2007, 04:11 PM
<img src="images/bigimage.jpg" width="720" height="95" usemap="#mapname" border="0"><map name="mapname"><area shape="rect" coords="16,22,129,74" href="http://www.targetwebaddresshere.com" target="_blank"></map>

slim150
07-03-2007, 04:52 PM
neat!!