开发者

Padding on a table not working

I'm trying to give even spacing all开发者_如何转开发 around images I have in a table, and it's not working too well.

Look at the page. I tried margin, padding, everything I could on lots of different types of properties, but no luck. Any help?


The table has been created in an unusual way by photoshop - resulting in dodgey markup.

  1. There a differing amount of <td>'s in the first row compared to the others
  2. There are several spacer images which have been created by photoshop; which are redundant
  3. There should be no need for the use of rowspans in your <td>'s

To fix this issue I would suggest modifying your table so the structure looks like this:

<table cellpadding="5">
  <tr>
    <td><a href="http://allure.dlvrall.com"><img src="images/index_01.png" width="463" height="200" alt=""></a></td>
    <td ><a href="http://liquor.dlvrall.com"><img src="images/index_02.png" width="465" height="200" alt=""></a></td>
  </tr>
....

Then keep adding blocks of table rows e.g.:

<tr>
      <td>... </td>
      <td>...</td>
</tr>

with your links and images replacing the '...'. then finally close the table:

</table>

Hope this helps.


The problem is your rowspan="2" on your second cell... remove that and the spacing evens out. You may also want the following CSS (tested with Firefox/firebug rewrites)

<style>
#Table_01,#Table_01 a {margin:0;padding:0;}
#Table_01 img {padding:1em;}
</style>


Try specifying value for cellpadding attribute for the table.


Your markup is all wrong. You have TDs using rowspan when its not needed and i see some spacer gifs. Fix the markup and you wont have any issues with using cellpadding

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜