首页 > 解决方案 > 如何将两个表与不同的列对齐

问题描述

我正在制作一个响应式网站,其中有两个垂直对齐的表格。结构如下:

[         title of table 1          ]
[       col1      ][       col2     ]

[         title of table 2          ]
[  col1  ][  col2  ][ col3 ][ col4  ]

标题行使用colspan="4",并且此表格布局适用于除 ios 之外的所有内容。

在 iphone 上检查此表时,布局如下所示:

[   title of table 1   ]
[   col1   ][   col2   ]

[         title of table 2          ]
[  col1  ][  col2  ][ col3 ][ col4  ]

有没有办法让它们在所有设备上的宽度相同?

我尝试将表格宽度设置为相同的像素值,并且也尝试设置单元格宽度。到目前为止还没有运气。

标签: htmlhtml-table

解决方案


推荐阅读