html - HTML表格填充不起作用
问题描述
我在我的网站上设置了一个简单的表格 - 我为表格使用了 HTML 代码 - 但我无法弄清楚为什么填充不起作用 - 我使用 CSS 和 JS 作为模态(我是初学者)。我什至将填充设置为 1000,但它什么也没做 - 图像彼此相邻。这是我的代码:
<table width="500" border="0" cellpadding="5">
<tr>
<td align="center" valign="center">
<a href="https://www.londonontariomortgages.ca/first time home buyer program.html"> <img id="myImg" src="table/first time home buyer.jpg" alt="First Time Home Buyer Ontario" style="width:100%;max-width:300px"> </a>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- The Close Button -->
<span class="close">×</span>
<!-- Modal Content (The Image) -->
<img class="modal-content" id="img01">
<!-- Modal Caption (Image Text) -->
<div id="caption"></div>
</div>
<br />
<b>First Time Home Buyer Program<b>
</td>
<td align="center" valign="center">
<a href="https://www.londonontariomortgages.ca/renew my mortgage.html"> <img id="myImg" src="table/renewing your mortgage.jpg" alt="Renewing Your Mortgage" style="width:100%;max-width:300px"> </a>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- The Close Button -->
<span class="close">×</span>
<!-- Modal Content (The Image) -->
<img class="modal-content" id="img01">
<!-- Modal Caption (Image Text) -->
<div id="caption"></div>
</div>
<br />
<b>Renewing Your Mortgage<b>
</td>
<td align="center" valign="center">
<a href="https://www.londonontariomortgages.ca/Guide to Getting a Mortgage.html"> <img id="myImg" src="table/guide to getting a mortgage.jpg" alt="Guide to Getting a Mortgage in London Ontario" style="width:100%;max-width:300px"> </a>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- The Close Button -->
<span class="close">×</span>
<!-- Modal Content (The Image) -->
<img class="modal-content" id="img01">
<!-- Modal Caption (Image Text) -->
<div id="caption"></div>
</div>
<br />
<b>Guide to Getting a Mortgage<b>
</td>
</tr>
</table>
如果有人可以提供任何建议,将不胜感激。
谢谢
解决方案
对于表格,您不能提供填充。对于“div”和其他元素,例如“P,跨度”,您可以提供填充。对于表格使用单元格填充。(如果您想看到将边框值设置为 1,那么您可以看到带边框的填充。)
推荐阅读
- sql-server - 使用多个表更新用例
- nodatime - NodaTime TimeZone 数据文件命名
- javascript - 如何在 PHP 文件中调用 JS 函数
- html - 根据提交的表单值更改表格颜色
- bash - 对登录的其他用户使用 source 命令
- ruby-on-rails - 将 docker socket 安装到容器中会使 rails 服务器崩溃
- html - 如何在按钮内正确集中跨度?
- nativescript - 无法验证 BarcodeScannerFramework.framework/BarcodeScannerFramework 中的位码
- kotlin - Kotlin - 在保持精度的同时将浮点数转换为双精度数
- swift - 我应该如何从 Firebase 将数据检索到 UICollectionViewCell?