• Stars
    star
    536
  • Rank 82,794 (Top 2 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Resizable table columns for jQuery.

jquery-resizable-columns

Resizable table columns for jQuery. Live Demo

New and Improved! Now tested and working on Chrome & Firefox (Mac + Windows), and IE 9 + 10. Other browsers might work too, just haven't had time to check.

Size: < 8kb minified

Dependencies

  • jQuery
  • store.js (or anything similar) for localStorage persistence.

Simple Usage

<table>
  <thead>
    <tr>
      <th>#</th>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Username</th>
    </tr>
  </thead>
  <tbody>
    ...
  </tbody>
</table>

<script>
  $(function(){
    $("table").resizableColumns();
  });
</script>

Persist column sizes

To save column sizes on page reload (or js re-rendering), just pass an object that responds to get and set. You'll also have to give your <table> a data-resizable-columns-id attribute, and your <th>s data-resizable-column-id attributes.

<script src="libs/jquery.js"></script>
<script src="libs/store.js"></script>
<script src="jquery.resizableColumns.js"></script>

<table data-resizable-columns-id="demo-table">
  <thead>
    <tr>
      <th data-resizable-column-id="#">#</th>
      <th data-resizable-column-id="first_name">First Name</th>
      <th data-resizable-column-id="last_name">Last Name</th>
      <th data-resizable-column-id="username">Username</th>
    </tr>
  </thead>
  <tbody>
    ...
  </tbody>
</table>

<script>
  $(function(){
    $("table").resizableColumns({
      store: store
    });
  });
</script>

License

MIT

Credits

There's various versions of this plugin floating around the internet, but they're all outdated in one way or another. Thanks to http://robau.wordpress.com/2011/06/09/unobtrusive-table-column-resize-with-jquery/ for a great starting point.

More Repositories

1

formbuilder

[Needs Maintainer] Formbuilder is a small graphical interface for letting users build their own webforms.
JavaScript
1,844
star
2

starrr

1-5 star rating, in jQuery.
JavaScript
220
star
3

filterer

πŸ” Object-oriented query building for ActiveRecord.
Ruby
123
star
4

openrfps-scrapers

Scraping government contracting opportunities.
CoffeeScript
61
star
5

wintersmith-knowledge-base

A static, developer-friendly, knowledge base built with Wintersmith.
CoffeeScript
55
star
6

formbuilder-rb

[UNMAINTAINED] Rails backend for https://github.com/dobtco/formbuilder
Ruby
53
star
7

procure-io

*NOT CURRENTLY MAINTAINED* Procurement software for the 21st century.
Ruby
41
star
8

dispatch

Dispatch is an application for cities to advertise their contract opportunities.
Ruby
11
star
9

palat

Generate beautiful, accessible color schemes from a single background color.
Ruby
9
star
10

beacon

[Not maintained] Beacon, originally built by CfA Pittsburgh 2015.
Python
4
star
11

writeforhumans.io

A tool that helps you write gooder.
JavaScript
4
star
12

fixing-procurement-ebook

7 Simple Ways to Modernize Enterprise Procurement
CSS
4
star
13

NAICS

Placeholder for NAICS innovation.
3
star
14

autosaver

Wraps your AJAX save logic in a cozy, edge-case-preventing blanket.
CoffeeScript
3
star
15

storage_unit

Soft deletion for Rails 4, done right.
Ruby
2
star
16

simple_form-dropdown_select

A more powerful dropdown input for Simple Form.
Ruby
2
star
17

openrfps-site

Informational website for the OpenRFPs project.
CSS
2
star
18

pretty_id

Add random, unique "pretty" ids to your ActiveRecord models.
Ruby
2
star
19

pretty_file_input

[DEPRECATED] Standardized file inputs for Ruby on Rails.
JavaScript
2
star
20

pdfjs_viewer-rails

fork of https://github.com/senny/pdfjs_viewer-rails
CSS
1
star
21

hubot

our chat bot. thanks github!
CoffeeScript
1
star
22

dvl-core

Base styles for the DOBT View Layer.
Ruby
1
star
23

inline_file_upload

Helper code for handling file uploads via AJAX.
JavaScript
1
star
24

fortitude-caching

Integrates Rails fragment caching with Fortitude.
Ruby
1
star
25

screendoor-project-templates

A shared collection of project templates for Screendoor.
1
star
26

screendoor-nps

Using Screendoor to collect Screendoor's Net Promoter Score.
Ruby
1
star
27

screendoor-appointment-dropdown

Simple integration for adding an "appointment time" dropdown to your Screendoor forms.
Ruby
1
star
28

screendoor-api-docs

Screendoor API Docs
JavaScript
1
star