我有一个非常基本的表结构,要放在网页的中间/中心。我有下面的代码,我知道实现它的不完整,因为我不擅长构建 HTML 部分,请帮助我
<div align="center" style="vertical-align:bottom">
<div align="center" style="vertical-align:bottom">
<table>
<tr><td colspan="2"></td></tr>
<tr><td>Name</td><td>J W BUSH</td></tr>
<tr><td>Proficiency</td><td>PHP</td></tr>
<tr><td>COmpany</td><td>BLAH BLAH</td></tr>
</table>
</div>
</div>
另请解释在实现这次结构化过程中应用属性和 CSS 背后的概念。这样我就可以在进一步的学习中使用它....
我完全是 HTML-CSS 使用的新手和笨蛋...所以我请求你们所有的技术人员和极客来忍受我关于 HTML-CSS 结构的愚蠢问题..请不要留下让我沮丧的评论继续前进学习诸如“这是作业吗……”或“去补习类”等……
最佳答案
最简短和最简单的答案是:您不应该将网页中的内容垂直居中。 HTML 和 CSS 根本就没有考虑到这一点。它们是文本格式化语言,而不是用户界面设计语言。
也就是说,这是我能想到的最好的方法。但是,这在 Internet Explorer 7 及更低版本中不起作用!
<style>
html, body {
height: 100%;
}
#tableContainer-1 {
height: 100%;
width: 100%;
display: table;
}
#tableContainer-2 {
vertical-align: middle;
display: table-cell;
height: 100%;
}
#myTable {
margin: 0 auto;
}
</style>
<div id="tableContainer-1">
<div id="tableContainer-2">
<table id="myTable" border>
<tr><td>Name</td><td>J W BUSH</td></tr>
<tr><td>Proficiency</td><td>PHP</td></tr>
<tr><td>Company</td><td>BLAH BLAH</td></tr>
</table>
</div>
</div>
关于html - 如何将 "table"放在网页中间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10042413/