Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function() {
- var widths = new Array;
- /* get max column widths from tables */
- $('table').each(function() {
- i = 0;
- $(this).find('thead th').each(function() {
- w = $(this).width();
- if (!widths[i]) {
- widths[i] = 0;
- }
- if (w > widths[i]) {
- widths[i] = w;
- }
- ++i;
- });
- });
- /* now that we have got the max column widths, apply them
- * to all tables so that the columns line up
- */
- $('table').each(function() {
- i = 0;
- $(this).find('thead th').each(function() {
- $(this).width(widths[i++]);
- });
- });
- });
- </script>
Add Comment
Please, Sign In to add comment