使用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/