title: How to remove width attribute from th tag using RegExp and .replace() function
body: <p>I have a table </p>
  
  <pre><code>&lt;thead id="tag_1985_103"&gt;
   &lt;tr id="tag_1983_103"&gt;
    &lt;th width="33.33%"  id="tag_1981_103" rowspan="1" colspan="1"&gt;Col 1 &lt;/th&gt;
    &lt;th width="33.63%"  id="tag_1980_103" rowspan="1" colspan="1"&gt;Col 2 &lt;/th&gt;
    &lt;th width="33.65%"  id="tag_1979_103" rowspan="1" colspan="1"&gt;Col 3 &lt;/th&gt;
   &lt;/tr&gt;
  &lt;/thead&gt;
  </code></pre>
  
  <p>I need to remove width attribute from every th tag, the value not unique.
  I tried following code, but not working..</p>
  
  <pre><code>var strcontent ='&lt;thead id="tag_1985_103"&gt;
  &lt;tr id="tag_1983_103"&gt;
  &lt;th width="33.33%"  id="tag_1981_103" rowspan="1" colspan="1"&gt;Col 1 
  &lt;/th&gt;
  &lt;th width="33.63%"  id="tag_1980_103" rowspan="1" colspan="1"&gt;Col 2 &lt;/th&gt;
  &lt;th width="33.65%"  id="tag_1979_103" rowspan="1" colspan="1"&gt;Col 3 &lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;';
  var srch_pattern = new RegExp('&lt;th width="(\d+)" ([^&gt;]+)&gt;', "gi");
  var replace_pattern = '&lt;th $1&gt;';
  strcontent = strcontent.replace(srch_pattern, replace_pattern);
  </code></pre>
  
  <p>Please suggest me a solution</p>