本文介绍了在对话框中的表的jQuery UI问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jQuery UI对话框,我应用了一个填充,而在对话框里面我有一个长桌子。然后,我将对话框配置为有限的高度,以便有一个滚动条。



似乎每当一个nowrap应用于表格单元格时,填充到右侧的表被滚动条覆盖。



这是一个可编辑的例子:



解决方案

似乎只有当您将对话框的宽度设置为 auto 时才会发生。



一种解决方法是将表的宽度设置为100%,并将对话框的宽度重置为固定长度。长度需要添加等于或大于滚动条宽度的填充。例如:

  var newWidth = $('。Dialog')。width()+ 50; 
$('。Dialog')。width(newWidth);

看到这个行动:。


I have a jQuery UI dialog to which I applied a padding, and inside the dialog I have a long table. I then configure the dialog to be of limited height in order to have a scrollbar.

It seems that whenever a nowrap is applied to the table cells, the padding to the right of the table is covered by the scrollbar. If I remove the nowrap, it works fine.

Here is an editable example:

http://jsbin.com/okolap/4/edit

解决方案

It seems that it only happens when you set the dialog's width to auto.

One workaround is to set the table's width to 100% and reset the dialog's width to a fixed length. The length needs to add a padding equal or larger than the width of the scroll bar. For example:

var newWidth = $('.Dialog').width() + 50;
$('.Dialog').width(newWidth);

See this in action: http://jsbin.com/okolap/10/.

这篇关于在对话框中的表的jQuery UI问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 02:57