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

10-23-2009, 02:40 PM
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?

10-23-2009, 03: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;

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

10-23-2009, 06: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;

10-23-2009, 06: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.

10-23-2009, 07: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?

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

10-23-2009, 08: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!!

10-23-2009, 09: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.