jQuery css selector quirk
<p><strong>Background:</strong></p>

<p>I have a CMS tool that allows users to create a table inside the content area.  If the option for a border is used, the tool sets the border attribute on the table, and does not use a style.  My reset stylesheet defaults all tables to no border, and this overrides the table border attribute (i.e., no border is displayed).</p>

<p>As a quick hack, I put in some jQuery to grab table elements that have a non-0 border attribute and convert the border attribute into an inline style.</p>

<p><strong>My question:</strong></p>

<p>While I was able to get the code to work, it is not the solution I originally intended.</p>

<p>This is currently working:</p>

<pre><code>    $("table[border!='0']").css('border', function() { 
         return $(this).attr('border') + "px solid"; 
    });
</code></pre>

<p>My original solution was to not require the function in the css method - </p>

<pre><code>$("table[border!='0']").css('border', $(this).attr('border') + "px solid");
</code></pre>

<p>I realize as I write this question that $(this) doesn't refer to each item in the selection, as it does inside the function, thus my problem.</p>

<p><a href="http://jsfiddle.net/eMan5/3/" rel="nofollow">jsFiddle</a></p>

<p>Is there a way to accomplish this without the function?</p>
