PDA

View Full Version : Do I need to use a table here?


djbutter22
10-23-2009, 03:40 PM
Hi,
I'm creating a page that will basically be a page full of 150x100 pixel buttons in the center. Roughly 10 buttons, in two colums. If I want to insert them on the page in a nice orderly fashion, would it be best to create a table and insert them into the cells?

domedia
10-23-2009, 04:19 PM
You can use this rule of thumb; If you think you need to use tables because of how your stuff should look, it's probably not right using it.

Sounds like all you need is to give the images the same classname, and then set that class to float: left;

djbutter22
10-23-2009, 05:03 PM
That's why you're the General! Thanks a lot!!! :)

djbutter22
10-23-2009, 07:02 PM
Ok, is this what I type in the code? <class="button.img"><img src="../images/Buttons/Drama Club Button Jabaricopy" alt="Drama" width="250" height="75" />

For the style I used float: left;

domedia
10-23-2009, 07:52 PM
There is no tag called <class>, it's an attribute.

So something like this <img class="galleryItem" />

Plus the other attributes you need of course.

djbutter22
10-23-2009, 08:50 PM
I want the buttons to line up side by side (two colums) do I need to make another style that makes the right side float right?

domedia
10-23-2009, 09:13 PM
No just add the same class to each image and you're good.

djbutter22
10-23-2009, 09:45 PM
ok here's the URL http://schools.cfisd.net/cylakes/HTML-PAGES/spartanlife.htm
I'm sure the code looks messed up. I can't get the images to go side by side is there something special I need to type?
You're a lifesaver by the way and so is this forum!!

domedia
10-23-2009, 10:35 PM
This is from your source:
<img class="button.img" img src="/cylakes/images/Buttons/band button.jpg" alt="band" width="250" height="75" />

The first attribute you have is CLASS. This has to a class name from your CSS, it cannot contain a dot afaik. Make sure whatever classname you use, that you have a corresponding CSS rule in your CSS that makes it float.

Then you have a single attribute IMG without any value. That attribute does not exist so you must remove it.

It also looks like your image are just a tad too wide, so you won;t be able to fit two across.