如何渲染2个html表彼此相邻?

前端之家收集整理的这篇文章主要介绍了如何渲染2个html表彼此相邻?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图像这样水平渲染2个表: @H_502_2@|表1 | |表2 |
| ——— | | ———- |
| ——— | | ———- |
| ——— | | ———- |

@H_502_2@这样做的正确方法是什么?

@H_502_2@目前,我得到了这个HTML

<div style="vertical-align:top;">
 <table style="display:inline-table;">
  ...1st table
 </table>
 <table  style="display:inline-table;">
  ...2nd table
 </table>
</div>
@H_502_2@有垂直对齐的麻烦,它会像这样呈现出来(表#2少了1行):

@H_502_2@|表1 |
| ——— | |表2 |
| ——— | | ———- |
| ——— | | ———- |

@H_502_2@我希望它从顶部开始.

@H_502_2@附:有related question,但我不想用w / div包裹它.

解决方法

尝试添加vertical-align:top或使用float:left而不是display:inline-table.

猜你在找的HTML相关文章