如何将一个新生成的div放到另一个div? [英] How to place a new generated div aside to another div?
问题描述
我有一个div,我放置一个Java Script生成的图表。另外,我得到了另一个div,其中我打印出一个带有图表数据结果的表。
一个例子是:
但是,对于UX目的我更喜欢将表放在图表的右侧。或者更多,使它出现在右边。 (我已经使用jQuery做一个 $(#resultados)。remove()
和 $(body)append ; table ...< / table>)
。
如何制作图表div,标记< div id =placeholderstyle =width:1200px; height:700px>< / div>
调整大小并将其放置到右侧的另一个生成的div? p>
到目前为止,考虑已经标记的div,我尝试这个但我没有得到我想要的结果:
- 表格div先出现,我想要相反。 / li>
- 它们不会将整个外部div宽度合并。
- 通过在其样式中设置
float:right
$ b - 使占位符div浮在左边(
float:left
)。 - 要动态更改其大小,
$(#placeholder)。css({width:600px);
- (
clear:both
);
I got a div where I place a Java Script generated chart. Also, I got another div where I print out a table with chart data results.
One example is:
However, for UX purposes I prefer the table to be placed on the right side of the chart. Or what's more, making it appear on the right side. (I already use jQuery to do a $("#resultados").remove()
and $("body").append("<table...</table>)
.
How can I make the chart div, which markup is <div id="placeholder" style="width:1200px;height:700px"></div>
resize down and make place to another generated div to its right side?
So far, thinking about already marked up divs I tried this but I'm not getting the results I want as:
- The table div appears first and I want the opposite.
- They don't take together the whole outer div width.
- Wrap your table with a right floating div by settting
float:"right"
in its style. - Make placeholder div to float on left (
float:left
). - To dynamically change its size, use :
$("#placeholder").css({"width":"600px");
- Finally , add a clear div (
clear:both
);
这篇关于如何将一个新生成的div放到另一个div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!