表中的 HTML 表

标签 html css

我对 HTML 和 CSS 有点菜鸟。我想知道什么是最好的方法:

1) 在一个页面上以正方形排列 4 个表格——即每个表格是一个象限,或者

2) 将 4 个表放在另一个表中。

如有任何建议,我们将不胜感激。

问候。

最佳答案

如果您想将页面拆分为 2X2 表格,最好的方法是使用 Divs(也更容易在 div 上应用 css)

<div style="width:auto;">
  <div style="float:left; width:50%">
     x-1,y-1
  </div>
  <div style="float:left; width:50%">
     x-2,y-1
  </div>
  <div style="clear:both"></div>
</div>
<div style="width:auto;">
  <div style="float:left; width:50%">
     x-1,y-2
  </div>
  <div style="float:left; width:50%">
     x-2,y-2
  </div>
  <div style="clear:both"></div>
</div>

http://css-discuss.incutio.com/wiki/Why_I_think_divs_are_better_than_tables

关于表中的 HTML 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10916094/

相关文章:

css - CSS 避免分页的正确方法是什么?

javascript - 动态添加变换 - 最后恢复到原始值

html - DIV 操作

html - 从 CSV/Flask 填充 Bootstrap 下拉按钮

html - 使用 select2 时保留输入验证 CSS 类

javascript - div 上的 jQuery hide() 和 show() 不起作用

css - 如何使所有图像尺寸相似?

html - 将一个 Div 重叠到另一个

html - Firefox下高度为0悬停效果

html - 为什么 Google 将 Logo 放在 <table> 中?