Forum Moderators: phranque

Message Too Old, No Replies

Table Spacing Question

         

kodaks

12:45 am on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Greetings,

I am very new to tables, and I have a question. I hope I can explain it well enough. Here is an example table that I use:

<tr>
<td width=100% height=20 class=l1a onmouseout="this.className='l1a';">
</b>&nbsp;Some text goes here
</td>
</tr>

The text budges up right to the left side of the table when I look at the page. I am wondering how I can space the text away from the left a little bit.

Thanks in advance!

deejay

2:30 am on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



adding cellpadding to your table tag will give you spacing from the table border.

<table cellpadding="10">

cellspacing is your other option, which puts space between the cells themselves.

kodaks

3:03 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks!

kodaks

6:06 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think I may still me doing something wrong. With the cellpadding, my code looks like:

<tr>
<a href="link3.html">
<td width=100% table cellpadding=10 height=20 class=l1a " onmouseout="this.className='l1a';">
</b>&nbsp;Some text here.....
</td>
</a>
</tr>

But the text is still bunched up right to the side.

deejay

6:58 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ahh no no.. like this:

<table cellpadding="10">
<tr>
<a href="link3.html">
<td width=100% height=20 class=l1a " onmouseout="this.className='l1a';">
</b>&nbsp;Some text here.....
</td>
</a>
</tr>
</table>

kodaks

7:02 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Now it works, thanks!

deejay

7:03 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



:) you're welcome

encyclo

8:54 pm on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<tr> 
<a href="link3.html">
<td width...

That doesn't look right at all - the link needs to be in a

td
, not just placed after a
tr
. You should really validate your HTML to avoid any rendering problems:

[validator.w3.org...]

kodaks

12:07 am on Sep 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, I got the HTML from a pre-made template and I am trying to sort out all the bad HTML.