jQuery UI issues with tables in dialogs

亡梦爱人 提交于 2019-12-11 09:26:06

问题


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


回答1:


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/.



来源:https://stackoverflow.com/questions/7615261/jquery-ui-issues-with-tables-in-dialogs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!