Git Product home page Git Product logo

jquery-resizecolumns's Introduction

resizeColumns jQuery Plugin

This jQuery plugin lets you enable super-simple column resizing on any HTML table. It also provides callbacks and javascript cookie writing to store the column widths for future use if desired.

Based off of the simple, working code provided at http://bz.var.ru/comp/web/resizable.html by "bz" (I don't speak Russian.)

Demo & Examples

See example.html

Example Usage

HTML

<table id="gpas" border="1">
	<thead>
		<tr>
			<th>Name</th>
			<th>Age</th>
			<th>GPA</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>Nano</td>
			<td>25</td>
			<td>5.0 baby</td>
		</tr>
		<tr>
			<td>Enia</td>
			<td>25</td>
			<td>1.0 boohoo</td>
		</tr>
	</tbody>
</table>
<span id="column_array_output"></span>

jQuery

$('table#gpas').resizeColumns();
$('table#gpas').live('change',function(event,widths_string){
	$('span#column_array_output').text(widths_string);
});

Notes

  • Very early release, bugs to work out, still some procedural code in there outside the plugin. I know :-) feel free to list them as issues in GitHub if you'd like me to prioritize them, or send a pull request with your awesome fix!
  • This should work with any HTML table that has <th> tags in it. If yours isn't working, check to make sure you didn't use <td> instead of <th>

License

This plugin is dual licensed under the MIT and GPL licenses, just like jQuery itself.

Credits

Thanks to "bz" for the initial code. Thanks to an unknown engineer at Justin.TV who insulted my code test by telling the recruiter to pass on me on grounds of "bad taste". That really upset me, and kicked my ass into programming overdrive.

jquery-resizecolumns's People

Contributors

workwithnano avatar

Watchers

Alvin-F avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.