title: To remove all style attributes BUT NOT TO REMOVE the style attributes which are available in table - PHP
body: <p><strong>How to To remove all style attributes <code>BUT NOT TO REMOVE</code> the style attributes which are 
  available in table</strong> - PHP</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;div style="text-align: justify; text-indent: -13.5pt; &gt;&lt;strong&gt;Motion with Constant Acceleration&lt;/strong&gt;&lt;/div&gt;
  &lt;table cellspacing="0" cellpadding="0" border="1" style="border: medium none; border-collapse: collapse;"&gt;
  &lt;tr&gt;&lt;td width="114" style="border: 1pt;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;td width="264" style="border-width: 1pt 1pt 1pt medium;" colspan="2"&gt;Data Sheet&lt;/td&gt;
  &lt;td width="157" style="border-width: 1pt 1pt 1pt medium;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr style="height: 0.4in;"&gt;&lt;td width="114" style="border-width: medium 1pt 1pt;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;td width="156" style="border-width: medium 1pt 1pt medium;"&gt;Incline angle&lt;/td&gt;
  &lt;td width="108" style="border-width: medium 1pt 1pt medium;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;td width="157" style="border-width: medium 1pt 1pt medium;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>My output should be like this (<strong>Note the div tag</strong>):</p>
  
  <pre><code>&lt;div&gt;&lt;strong&gt;Motion with Constant Acceleration&lt;/strong&gt;&lt;/div&gt;
  &lt;table cellspacing="0" cellpadding="0" border="1" style="border: medium none; border-collapse: collapse;"&gt;
  &lt;tr&gt;&lt;td width="114" style="border: 1pt;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;td width="264" style="border-width: 1pt 1pt 1pt medium;" colspan="2"&gt;Data Sheet&lt;/td&gt;
  &lt;td width="157" style="border-width: 1pt 1pt 1pt medium;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr style="height: 0.4in;"&gt;&lt;td width="114" style="border-width: medium 1pt 1pt;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;td width="156" style="border-width: medium 1pt 1pt medium;"&gt;Incline angle&lt;/td&gt;
  &lt;td width="108" style="border-width: medium 1pt 1pt medium;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;td width="157" style="border-width: medium 1pt 1pt medium;"&gt;&lt;div align="center"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>