IE 中表格单元格中的浮动 DIV
首先,对不起我的英语。我正在尝试用纯 Javascript 制作可拖动且可调整大小的表格列。我在单元格内插入了 2 个区域,一个用于拖动(div),第二个用于调整大小(span),就像您在下面的示例中看到的那样。在 Chrome 和 Firefox 中一切正常,但在 IE8 中则不然。
问题是在调整大小期间,当 div 不适合单元格并跳转到单元格下时,您可以在 图片。我建议属性“overflow:hidden”应该修复它,但没有运气。
CSS:
.ui-column-resizable
{
float:right;
height:20px !important;
display:inline;
cursor:w-resize;
position:relative;
overflow:hidden;
text-align:center;
white-space:nowrap;
background-color:blue;
margin: -2px -2px -2px 0;
}
.ui-column-draggable
{
height:17px;
cursor:move;
position:relative;
overflow:hidden;
background-color:yellow;
white-space:nowrap;
text-align:center;
}
JavaScript:
column.innerHTML = "<span class='ui-column-resizable'> </span>" +
"<div class='ui-column-draggable'>" +
column.innerHTML +
"</div>";
first fo all, sorry for my english. I am trying to do dragable and resizible table columns in pure Javascript. I inserted inside a cell 2 areas, one for draging (div) and 2nd for resizing (span) like you can see in example bellow. Everything works fine in Chrome and Firefox but not in IE8.
Problem is during resizing when div doesn't fit in cell and jump under cell as you can see "Column1" in image. I would suggest property "overflow:hidden" should fix it, but no luck.
CSS:
.ui-column-resizable
{
float:right;
height:20px !important;
display:inline;
cursor:w-resize;
position:relative;
overflow:hidden;
text-align:center;
white-space:nowrap;
background-color:blue;
margin: -2px -2px -2px 0;
}
.ui-column-draggable
{
height:17px;
cursor:move;
position:relative;
overflow:hidden;
background-color:yellow;
white-space:nowrap;
text-align:center;
}
JavaScript:
column.innerHTML = "<span class='ui-column-resizable'> </span>" +
"<div class='ui-column-draggable'>" +
column.innerHTML +
"</div>";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以...
HTML:
CSS:
现场演示: http:// /jsfiddle.net/simvidas/5mzgP/3/
This should do it...
HTML:
CSS:
Live demo: http://jsfiddle.net/simevidas/5mzgP/3/