title: jquery - how to addClass based on the content of an element?
body: <p>Suppose you have a table like this:</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;Group 1&lt;/td&gt;
  &lt;td&gt;some data here&lt;/td&gt;
  &lt;td&gt;Group 2&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>and you want it to be like this:</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;
  &lt;td class="group1"&gt;Group 1&lt;/td&gt;
  &lt;td&gt;some data here&lt;/td&gt;
  &lt;td class="group2"&gt;Group 2&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Both Nick Craver's and Kevin's solutions here below work nicely. Thanks guys! Why would I wnted to do such thing? To style a timetable for a non-profit organization that provides workshops.</p>