我正在使用PHP和HTML创建Bootstrap表。这是我正在生成的包含弹出窗口的单元格的示例:
echo '<td colspan="' . $newlength . '" rel="popover" id="example" data-toggle="popover" data-content="Content!!!" data-title="<img src=\'myimage.jpg\' width=\'45\' height=\'30\' />   Title">Content!!!</td>';
这是我的脚本:
$('[data-toggle="popover"]').popover({
trigger: 'click',
'placement': 'bottom',
html: 'true' });
我的问题是,当我激活一个弹出框时,表格的下一行的宽度会增加,就好像是要容纳该弹出框一样,然后将其调整为正常大小。有什么办法可以阻止这种情况发生吗?
编辑:试图重现该问题-尽管在bootply上它并不完全相同(表在水平方向而不是在垂直方向上调整大小),但它是相似的。http://www.bootply.com/91456
您可以将container
选项用于.popover()
...
$('[data-toggle="popover"]').popover({
trigger: 'click',
placement: 'right',
html: 'true',
container: '.table'
});
这会将popover元素附加到表而不是表单元格。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句