无论如何,强制浮动,没有换行 [英] Force float left with no line break no matter what

查看:159
本文介绍了无论如何,强制浮动,没有换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我猜这是不可能的,但是这里有。

I'm guessing this isn't possible, but here goes.

我有两张桌子,而我正试图让他们坐在旁边这样他们看起来像一张桌子。这样做的原因是,由于性能原因(如缓存和AJAX获取数据),第二个表中的数据需要以列为基础而不是以行为基础进行处理。因此,我决定将列拆分为一个单独的表,而不是必须为一个列重新加载整个表,但它在视觉上看起来像是一个表。

I have two tables, and I'm trying to get them to sit side-by-side so that they look like one table. The reason for this, instead of using one larger table, is that the data in the second table needs to be handled on a column basis, not row basis, for performance reasons like caching and AJAX-fetching data. So rather than have to reload the whole table for a single column, I decided to break the column out into a separate table, but have it visually seem like a single table.

我找不到强行把第二张表放在第一张表旁边的方法。我可以浮动它们,但是当第一个表太宽时,第二个表会突破到下一行。这是踢球者:第一个表的宽度是动态的。所以我不能只为它们的容器设置一个巨大的宽度。好吧,我可以设置一个巨大的宽度,比如1000%,但是我有一个巨大的丑陋的水平滚动条。

I can't find a way to forcibly put the second table next to the first. I can float them, but when the first table is too wide, the second one breaks to the next line. Here's the kicker: the width of the first table is dynamic. So I can't just set a huge width to their container. Well, I could set a huge width, like 1000%, but then I have a huge ugly horizontal scroll bar.

那么有什么方法可以告诉第二个表请保持同一条线,不管是什么!请在前一个元素旁边排队!

So is there any way to tell the second table "Stay on that same line, no matter what! And line up right next to the previous element please!"

推荐答案

放你的两个具有单行和两个单元格的另一个表中的表。不优雅或现代,但它会起作用。

Put your two tables in another table with a single row and two cells. Not elegant or 'modern' but it will work.

这篇关于无论如何,强制浮动,没有换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆