PDA

View Full Version : Problem with Tables/Allignment


Corey
03-18-2006, 07:28 PM
Ok, so I have an all CSS layout, but I need some way of seperating items, like in an online store. This might be a little confusing, so I'll try to explain it as best I can.
So I have a content box, I put three images (in this case t-shirts), they all align like they should.

http://i6.photobucket.com/albums/y250/proskater5/screenshot1.jpg

But I want to add text directly below each item. If I do this without tables, It will screw up the alignment of the images. I need to add tables I'm pretty sure do do this. I tried just using this:
<td align="center" valign="top" width="180"><LINK, IMAGE SRC, ETC...></td>
But that also screwed it up. Here's an example of what I'm talking about, look at the t-shirt section of this page: http://www.activemailorder.com/Catalog/category.aspx?j~&cp=1&ct=4

Thanks in advance for your help!

Creative Insanity
03-18-2006, 07:32 PM
That example uses tables.. I suggest you do the same.. Tables rule, divs suck LOL

Corey
03-18-2006, 09:36 PM
so your saying just scrap this and create a table layout just like it?

Creative Insanity
03-18-2006, 10:56 PM
Yeah I recon.. come into the light and leave the dark side and their divs alone LOL

Corey
03-19-2006, 03:43 AM
Alright, so I switched to a table layout. But I don't know much about tables. I want to do the same as that sample site, but I'm not sure how to. Here's the code for that section of the site.

</td><td align="center" valign="top" width="80%">
<font size="2" face="verdana,arial,helvetica,sans-serif">



<u>Popular Items</u>




images/maincombo_small.gif (images/maincombo.gif)
images/womhawaiian_small.gif (images/womhawaiian.gif)
images/stencil_small.gif (images/stencil.gif)

</font>

I just got the layout off a website, so I'm not sure what to change to get what I want.
Do I just make a bunch of seperate tables for each item? Or can I organize them all into one big table, like the one in the code above?

Thanks alot for your help.

d a v e
03-19-2006, 09:33 AM
that site just has a tshirt in each table *cell* and a line break after it
and then the text is just written after that. you could have done exactly the same using divs ;)

Corey
03-19-2006, 09:36 PM
ah well, i changed it to a table layout. and i got it to work how i wanted it. So its cool. I'll post up a link once i finish it and get it uploaded. Thanks for your help

dthomsen8
03-20-2006, 01:43 PM
ah well, i changed it to a table layout. and i got it to work how i wanted it. So its cool. I'll post up a link once i finish it and get it uploaded. Thanks for your help

There are advocates of CSS and newer methods, and advocates of tables and older methods here, and some of them will preach to you. I get preached at elsewhere for using HTML 4.O1, but I would suggest to you that eventually you will want to use CSS rather than tables.

Certainly you want to use CSS for specifying fonts and type sizes, not <font> tags.

d a v e
03-20-2006, 02:09 PM
that's not to say of course that while it is recommended to use only css for layout you can still use css WITH tables :)

domedia
03-20-2006, 02:28 PM
Absolutely, HTML and CSS should work perfect together. I try to make my tables look like this (example):
<table id="products">
<tr>
<th>Model</th>
<th>Price</th>
<th>Weight</th>
</tr>
<tr>
<td>#1</td>
<td>$150</td>
<td>200 lbs</td>
</tr>
<tr>
<td>#2</td>
<td>$250</td>
<td>400 lbs</td>
</tr>
<tr>
<td>#3</td>
<td>$350</td>
<td>500 lbs</td>
</tr>
</table>

Structure is right, and CSS applied afterwards