我的桌子有什么问题?

时间:2010-10-27 12:57:35

标签: html

以下是表格的代码:

<table align="center" width="303" height="740" border="1" cellpadding="10">
  <tr>
    <th width="130" height="41" scope="col">URL1 - Normal</th>
    <th width="121" scope="col">URL2  - Hover</th>
  </tr>
  <tr>
    <td height="94"><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-green.png"/></td>
    <td><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-green-h.png" alt=""/></td>
  </tr>
  <tr>
    <td height="124"><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-blue.png" alt=""/></td>
    <td><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-blue-h.png" alt=""/></td>
  </tr>
  <tr>
    <td height="147"><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-grey-h.png" alt=""/></td>
    <td><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-grey.png" alt=""/></td>
  </tr>
  <tr>
    <td height="137"><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-pink.png" alt=""/></td>
    <td><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-pink-h.png" alt=""/></td>
  </tr>
  <tr>
    <td height="132"><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-red.png" alt=""/></td>
    <td><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-red-h.png" alt=""/></td>
  </tr>
  <tr>
    <td height="132"><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-black.png" alt=""/></td>
    <td><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-black-h.png" alt=""/></td>
  </tr>
</table>

当我插入表格时,它会在表格和文本之间留下空隙。如果我删除表,那么一切都很好。这里出了什么问题?

4 个答案:

答案 0 :(得分:5)

Blogspot会为您插入换行符 ...然后他们会推倒表格。 (我还没有找到解决方法。)

如果您查看来源,可以看到它们:

<table align="center" width="303" height="740" border="1" cellpadding="10"><br />
  <tr><br />
    <th width="130" height="41" scope="col">URL1 - Normal</th><br />
    <th width="121" scope="col">URL2  - Hover</th><br />
    </tr><br />
    <tr><br />
    <td height="94"><img src="http://i1018.photobucket.com/albums/af309/5416339/ad-green.png"/></td><br />
    ...

因为直接在BRTABLE内或TRTH之后TD无效,浏览器会将这些元素推出渲染DOM时,表格及其上方。

答案 1 :(得分:1)

它与桌子无关。事实上,在表格之前有31个<br>(换行符)标签(这些标签正在创造巨大的差距。

听起来像BlogSpot(或您正在使用的任何博客服务)正在根据您格式化其余内容的方式添加额外的<br>代码。如果可能的话,编辑页面的源代码并手动删除它们......否则它会成为您所使用的任何博客平台的支持问题。

答案 2 :(得分:1)

如果你看一下页面的来源,你会注意到你的表中散布着<br/>个TON标签(但不包含在单元格元素中)。它们呈现在桌子上方。

看起来您的HTML正在被某些内容解析,并且您的换行符正在被BR标记替换。

快速解决方案:删除所有换行符,并将表格代码放在一行:)

答案 3 :(得分:0)

这与table标记中的任何内容无关。查看该页面的HTML源代码会在表格前面显示大约30个<br>个标记。他们显然对额外的空间负责。

为什么在插入表格时获得30个<br>标记必须与blogspot.com格式化内容的方式有关。您最好的选择是手动编辑HTML以删除<br>标记。如果你不能这样做,或者在编辑HTML时没有出现<br>标签,那么这就是Blogspot客户服务的问题。