Forum Moderators: not2easy

Message Too Old, No Replies

padding problem

         

adamnichols45

9:21 pm on Dec 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

Im trying todo a menu and the padding looks bloated.

im using this format

<tr><td class="line">&nbsp;<a href="" class="as2">wid 2</a></td></tr>
<tr><td class="line">&nbsp;<a href="" class="as2">wid 3</a></td></tr>
<tr><td class="line">&nbsp;<a href="" class="as2">wid 4</a></td></tr>

but there is a big gap between the links.

Any quick fixes guys? Tried - 5px

londrum

9:40 pm on Dec 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it could only be a few things, so i would put style="padding:0" in each of the elements in turn, until you find out which one it is.
so do:
<td class="line" style="padding:0">
and then
<a href="blah blah" class="as2" style="padding:0">
if it isn't one of them, then turn off the borders on the <td>'s and see if it's that.

you could do the whole thing a lot easier and cleaner by marking it up as a list, though, by the way.

<ul>
<li><a href="">wid 2</a></li>
<li><a href="">wid 2</a></li>
<li><a href="">wid 2</a></li>
</ul>

instead of putting class="as2" on each of the links, you could just put it once on the <ul> instead, and do your css like this:
ul.as2 a{blah blah blah}
if you want the links to appear as buttons, like in your table, then that's easy too. just do something like this:
ul.as2 li{display:block;background-color:red;color:white}

adamnichols45

11:27 pm on Dec 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks but still not working.

cmarshall

11:42 pm on Dec 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ALWAYS declare a <table> with cellpadding and cellspacing.

I typically declare a <table> like so:

<table class="my_class" id="my_id" cellpadding="0" cellspacing="0">

Also, make sure of your DOCTYPE and XML header. These can make a difference as to how browsers interpret the page.

adamnichols45

12:35 pm on Dec 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Again i always do declare the <TABLE> tag with cellpadding and spacing set to "0"

Still the same problem on this though

cmarshall

1:00 pm on Dec 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What, exactly do you mean by "looks bloated"? Does this mean only on the sides (left/right), or all around?

If it were only left/right, then it may be an issue of whitespace. Otherwise, I must declare myself bereft of Clue, and will see what transpires.