控件的位置 [英] Positioning of controls
本文介绍了控件的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在一个项目中,需要在可重复控件中按定义的位置排列控件.
我将表格用作可重复控件,但是当我设置单元格相对位置并将所有子位置设置为绝对位置时,单元格不会获得宽度和高度.
我已经测试过了:
I am working in a project in which i need to arrange controls by defined position in a repeatable control.
I use table as a repeatable control but when I set position of a cell relative and set all children positions absolute then the cell doesn''t get width and height.
I have tested this:
<table border="1" style="position:absolute;right:10px;top:20px">
<tr>
<td style="position:relative;"><div style="background-color:Red;width:100px;height:40px;position:absolute;top:0;right:0"></div></td>
</tr>
<tr>
<td style="position:relative"><div style="background-color:blue;width:100px;height:40px;position:absolute;top:0;right:0"></div></td>
</tr>
</table>
我需要,每个控件都出现在每个单元格中.
I need, each control appears in each cell.
推荐答案
使用div比使用表格要好.
检查此 [
It''s better to use div''s than tables.
Check this[^] for more on div''s.
这篇关于控件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文