在可排序列表中对齐不同表的列
我有一个可排序列表,每个可排序项目都包含一个表格。我想对齐所有表中的列。在CSS中使用table-layout:fixed效果很好,但是当单元格内容太长时,内容会重叠。我希望表格能够扩展以适合单元格中的内容,并且如果没有足够的水平空间,则应该出现水平滚动条。
我试图解决这个问题,将所有内容都放在一个表中,但这不好,因为在某些情况下,额外的内容会出现在排序项的表下,而且,使用 jquery 对表行进行排序也不能很好地工作。
代码的简化版本在这里: http://jsfiddle.net/buZUz/1/
I have a sortable list, each sortable item contains a table. I would like to align the columns from all the tables. Using table-layout: fixed in CSS works fine, but when the cell contents are too long, the contents overlaps. I would like the tables to expand to fit the content in the cells and horizontal scrollbar should appear if there's not enough horizontal space.
I tried to resolve this putting everything in one table, but this is not good, because in some cases extra content appears under the table in the sort item, and also, sorting table rows with jquery is not working so fine.
The simplified version of the code is here: http://jsfiddle.net/buZUz/1/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您在这里尝试使用多个表实现的目标将很难在不同的浏览器上实现和工作。我过去在 table-layout:fixed 方面遇到过很多“问题”,但现在从不使用它。
我很想回到一张表并使每一行都可排序。
要获取每行数据下的额外内容,您可以:
I think what you are trying to achieve here with multiple tables will be very difficult to achieve and make work accross different browsers. I have had a lot of "issues" in the past with table-layout:fixed and now never use it.
I'd be tempted to go back to one table and make each row sortable.
To get the extra content under the data in each row you could :