html - 我的 table 怎么了?

标签 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>

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

最佳答案

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 />
    ...

因为 BR 直接在 TABLETR 中或在 TH 之后无效TD,浏览器在呈现 DOM 时将这些元素推出表格上方。

关于html - 我的 table 怎么了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4033436/

相关文章:

html - 如何获得垂直子菜单而不是水平子菜单?

html - 强制 SVG 根据百分比高度调整大小

php - 为什么这个标准的正则表达式不能在 PHP ereg 函数中工作

php - 奇怪的类(Class)行为;在不应该应用时应用到下拉列表选项

html - 在 DIV 中滚动?

jquery - 如何使用 jQuery、AJAX 和 CodeIgniter 在点击时填充 div

javascript - 对一个类而不是所有具有相同名称的类执行操作/功能

javascript - 看不到文本区域上的数据

jquery - Bootstrap Glyphicons 更改按钮上的字体系列

javascript - 在 ng-repeat 循环中调用方法