Help - Search - Members - Calendar
Full Version: cellpadding, cellspacing, margins, borders
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Momruoy
I'm in the process of designing http://www.yandwproductions.com/ and I just can't get the sidebar to line up for the life of me. I've set all the margins, padding, spacing, borders, EVERYTHING to 0 and yet there's still a several pixel gap between the image links that I want gone.

What more can I do to put them in the right spot?
Shadeaux
Is there any particular reason you want it in a table?

Without seeing the stylesheet, it's hard to tell what might be causing it. Also, and I may be incorrect on this, but I believe you need "" marks around the name of the class.

Dave
Darin McGrew
QUOTE(Shadeaux @ Apr 27 2007, 09:01 AM) *
Also, and I may be incorrect on this, but I believe you need "" marks around the name of the class.
For HTML, quotes around attribute values are often optional. See the FAQ entry Should I put quotes around attribute values?
Darin McGrew
A quick check found that the widths of your table rows don't match up. If you're going to specify widths for everything, then they need to match up. But I recommend that you simplify the markup. For example, you could eliminate the nested tables, and use ROWSPAN and COLSPAN instead. And I also recommend that you not use a fixed-width design.

When debugging the structure of tables (layout tables or data tables), it helps to turn on borders everywhere. You can turn them off again once you've got the structure right.

While you're at it, the online tools report a number of HTML errors and CSS errors that you should fix.
Momruoy
QUOTE(Darin McGrew @ Apr 27 2007, 11:53 AM) *
I recommend that you simplify the markup. For example, you could eliminate the nested tables, and use ROWSPAN and COLSPAN instead.

I've never used ROWSPAN or COLSPAN, how would I implement them? Is there a quick and dirty tutorial somewhere I can check on?

Should I just eliminate the tables altogether and just use DIVs and SPANs?
Would they achieve the same effect?
pandy
No, if you you want to ditch tables you should use maningful elements like P, proper headings and so on. DIVs only to create sections and SPAN almost never. Actually, you should do that even if you keep the tables. happy.gif

Meanwhile, there's a short explanation of rowspan and colspan here: http://htmlhelp.com/reference/html40/tables/td.html .

Maybe this can illustrate.
HTML
<table border="2">
<tr>
<td>aaa aaa aaa</td>
<td>bbb bbb bbb</td>
</tr><tr>
<td colspan="2">ccc ccc ccc</td>
</tr>
</table>


There are two cells in the first row, creating two columns, but only one cell in the second row. The cell in the second row has to span two columns.
Momruoy
QUOTE(Shadeaux @ Apr 27 2007, 11:01 AM) *
Is there any particular reason you want it in a table?


It doesn't have to be in a table, I just thought that would be easiest from a developing standpoint.
I didn't expect there to be so many issues involved with tables.

Is there another way to do it?
Momruoy
Phew, figured it out!

Instead of having nested tables, it now uses nested DIVs. Much better control.

Thanks for the help, guys!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.