title: jQuery width() returning incorrect values on table cells
body: <p>In a plugin I'm writing I'm having terrible trouble with widths of table cells. All I do is get the width of the table cell using jQuery's <code>.width()</code> function, then <em>set that same cell</em> to be the width returned. Basically, this:</p>
  
  <pre><code>$table.find('&gt; thead &gt; tr &gt; th').each( function() {
      var $th = $(this);
      $th.css({width: $th.width()});
  } );
  </code></pre>
  
  <p>However, in many instances the width returned is incorrect and setting it changes the width of the cells. At first it just seemed like it was off by 1px so I added 1px to the returned width. But with thicker borders it's off by more - however it doesn't seem to be a case of simply adding the border width. For starters, there are obviously 2 borders but it's only off by the width of 1 border. And with varying border widths it seems almost random which value you need to add.</p>
  
  <p><a href="http://codepen.io/svivian/full/lpaiv" rel="noreferrer">Here's an example with my code</a> - the width-setting part runs 1 second after page load so you can see the change. Is there a reliable way to get/set the width of table cells in Javascript?</p>