使用jQuery可调整大小的表列(表宽于页面) [英] Resizable table columns with jQuery (table wider than page)

查看:90
本文介绍了使用jQuery可调整大小的表列(表宽于页面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个相对简单的解决方案,以允许调整表列的大小.还有一个类似的问题:

I'm looking for a relatively simple solution to allow table column resizing. There's a similar question:

使用jQuery可调整大小的表列

我真的很喜欢简单的解决方案; jsfiddle.net/ydTCZ/

I really like the simple solution; jsfiddle.net/ydTCZ/

但是它在我的桌子上不起作用(这似乎是因为桌子比屏幕宽).如果我将表格简化为仅几列,那么效果很好.

But it doesn't work on my table (it seems to be because the table is wider than the screen). If i simplify my table to just a couple of columns it works fine.

推荐答案

将其破解.

我的列标题<th>的内容是链接(<a> s).

The contents of my column headers <th>s are links (<a>s).

我不得不将<a>的样式设置为display: block

Instead of doing anything with the <th> I had to set the style of the <a>s to display: block

然后只是$('th a').resizable({handles:'e'});

我应该注意我同时加载了jQuery和jQuery UI. JSFiddle示例; http://jsfiddle.net/u32a1ccL/

I should note I have both jQuery and jQuery UI loaded. JSFiddle example; http://jsfiddle.net/u32a1ccL/

这篇关于使用jQuery可调整大小的表列(表宽于页面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆