Discussion Locked

getting rid of spaces in table

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to get rid of the spaces in my html table so that my images line up correctly..
The width of the cells is ok.. it the height that is giving me problems.. Any suggestions.
Dwayne

5 replies

by twistypigeon

There are a lot of little things in table cells (

) that can cause misalignment.
A has properties such as padding, border width, and alignment.
Ensure that padding is at the required level. This sets a space inside the cell itself.
Ensurethat border width is also at a decent figure. This sets spaces around the cell itself and between the cells.
Also ensure that the alignment of the image inside the cell is correct.

If you want even more control, use an inline style for the particular cells, or define a default style for the TD object.
eg

by jay eckles

You should definitely use CSS to do this type of visual alignment; any thorough CSS tutorial should go into the subject. However, if you're stuck with tables for some particular reason, then in the table tag, try the attributes
cellspacing=0
cellpadding=0
and when you're coding your table, don't put any whitespace between the opening and closing td tags and the content of the cell:

like this not like this

If this doesn't address your problem, then I suggest you provide some example HTML to demonstrate the specific problem you're having.

Good luck.

Jay Eckles

This discussion is closed to new replies.