html - 在 Github Flavored Markdown 中水平居中表格
问题描述
我有一张用github 风格的 markdown写的表。它在 Github 自述文件中用于存储库。
我需要将表格水平居中,我尝试在几个标签(也有父标签)中定义对齐属性,但这似乎对对齐没有任何影响。
这是我使用的代码:
<h1 align="center">
<br>
<table align="center">
<tr><td>
<img src="./res/logo_static.png" width="200" alt="PasteMyst.Pas">
</td></tr>
</table>
</h1>
logo_static 是我保存在同一目录中的图像,也忽略了使用的 alt 名称。
解决方案
.center {
margin-left: auto;
margin-right: auto;
}
<table class="center">
<tr>
<td><img src="https://via.placeholder.com/150"></td>
</tr>
</table>
推荐阅读
- php - 如何在 Laravel 中获得最后 7 天?
- python - 使用 AWS 在 python 中解密 + base64 问题
- vue.js - 为什么我无法通过 ip 地址访问我的 vue 应用程序?
- c++ - 在 Sublime text 3 中编译甚至简单的 C++ 程序时出错
- android - 在我的 Android 应用中查询应用内购买
- python - XML 到字典提取
- python - DRF, "required": "此字段为必填项。"
- outlook - 无法在 POP/IMAP 服务器的 Outlook 中看到商店图标
- javascript - 接口和抽象类(JS)的区别
- javascript - 如何从html接收js函数中的值