This time I will share jQuery Plugin and tutorial about Auto Adjust Parent Width Based On Child Widths – Wrapper Resizer, hope it will help you in programming stack.
Wrapper Resizer is a jQuery element resize plugin that automatically resizes parent/wrapper/container width so that all children are covered.
Suitable for fixed-width containers where the width of child elements is variable.
How to use it:
1. Download and insert the Wrapper Resizer plugin’s script jquery-plugin-wrapper-resizer.js
after jQuery.
1 |
< script src = "/path/to/cdn/jquery.min.js" ></ script > |
2 |
< script src = "/path/to/jquery-plugin-wrapper-resizer.js" ></ script > |
2. Attach the function wrapChilds
to the parent container and the plugin will do the rest.
02 |
< table class = "my-table table table-bordered table-striped" > |
12 |
< td >Lorem ipsum dolor sit amet, consectetur adipiscing elit. </ td > |
17 |
< td >Quisque est ex, pulvinar et aliquet eu, aliquet sit amet sem. </ td > |
1 |
window.onload= function (){ |
2 |
$( 'div.wrapper' ).wrapChilds(); |
This awesome jQuery plugin is developed by earth-the-home. For more Advanced Usages, please check the demo page or visit the official website.