title: How to apply conditional CSS for numeric field?
body: <p>I have scenario like, I have table which generates dynamically. Table may contain number fields as well as text fields. I give a specific CSS to that table. I want that where there is text field in table I give  <code>text-align: center;</code> and where there is number field in table I give <code>text-align: right;</code> Can I do this applying CSS using single Id/Class? Can we give <code>if condition</code> that recognize table fields are number or text in CSS file? </p>
  
  <p>This is my table which is generated dynamically</p>
  
  <pre><code>&lt;table class="alignCSS"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
  
          &lt;th&gt;
              Doctor Name
          &lt;/th&gt;
  
          &lt;th&gt;
              Amount
          &lt;/th&gt;
  
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
  &lt;% foreach (var item in Model) { %&gt;
      &lt;tr&gt;
  
          &lt;td&gt;
              &lt;%: Html.DisplayFor(modelItem =&gt; item.Doctor_Name) %&gt;
          // text field here i want to apply center alignment using CSS
          &lt;/td&gt;
  
          &lt;td&gt;
              &lt;%: Html.DisplayFor(modelItem =&gt; item.Amount) %&gt;
  
          //number field here i want to apply right alignment using CSS
          &lt;/td&gt;
  
      &lt;/tr&gt;
  &lt;% } %&gt;
  &lt;/tbody&gt;
  
  &lt;/table&gt;
  </code></pre>