title: I cannot apply CSS in html table
body: <p>I cannot apply the CSS in the table. For example I want the table to be displayed in the middle and to change the font color and size as well. But I can't. Should I use the <code>tbody</code> tag since I have the <code>body</code> one? Also I generate the table data from database.</p>
  
  <pre><code>    &lt;?php 
  
        include 'connect.php';
  
        $year = $_POST['year']; 
        $lecturer = $_POST['lecturer']; 
        $years     = array(
            2005,
            2006,
            2007
        );
       $lecturers = array(
           'lec1',
           'lec2',
           'lec3',
           'lec4'
        );
  
      if (in_array($lecturer, $lecturers) &amp;&amp; in_array($year, $years)) {
  
             $sql = "SELECT unit_name,a1,a2,a3,l1,l2,r1,r2,u1,u2,u3 FROM $lecturer WHERE year=$year";
  
             $result = mysql_query($sql);
       }
  
      else {
           echo "No data found";
      }
  ?&gt;
       &lt;html&gt;   
        &lt;head&gt;
      &lt;link rel="stylesheet" type="text/css" href="../../statistics/style.css"&gt;
        &lt;/head&gt;
         &lt;body&gt;
           &lt;div id="mytable"&gt;
             &lt;table width="900" border="1" cellspacing="1"&gt;
                 &lt;tr&gt;
                   &lt;tbody&gt;
                    &lt;td&gt;Unit Name&lt;/td&gt;
                    &lt;td&gt;A1 &lt;/td&gt;
                    &lt;td&gt;A2 &lt;/td&gt;
                    &lt;td&gt;A3 &lt;/td&gt;
                    &lt;td&gt;L1 &lt;/td&gt;
                    &lt;td&gt;L2 &lt;/td&gt;
                    &lt;td&gt;R1 &lt;/td&gt;
                    &lt;td&gt;R2 &lt;/td&gt;
                    &lt;td&gt;U1 &lt;/td&gt;
                    &lt;td&gt;U2 &lt;/td&gt;
                    &lt;td&gt;U3 &lt;/td&gt;
          &lt;/tbody&gt;
        &lt;/tr&gt;
  
    &lt;?php
         while($unit=mysql_fetch_assoc($result)){
          echo "&lt;tr&gt;";
          echo "&lt;td&gt;".$unit['unit_name']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['a1']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['a2']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['a3']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['l1']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['l2']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['r1']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['r2']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['u1']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['u2']."&lt;/td&gt;";
          echo "&lt;td&gt;".$unit['u3']."&lt;/td&gt;";
          echo "&lt;/tr&gt;";    
         }
     ?&gt;
     &lt;/table&gt;
     &lt;/div&gt;
    &lt;/body&gt;
    &lt;/html&gt;
  
  
  css:
  
  
        &lt;!-- principalLecturers
       --&gt;
        #body{
          color:white;
          padding-bottom: 20px;
         }
        #table{
          margin:0;
          border-collapse: collapse;
          color:#b50a1e;
          font-family:verdana,arial,sans-serif;
          font-size:10px;
         }  
         #table#mytable{
           display: table-row-group;
           vertical-align: middle;
           border-color: inherit
         }
  </code></pre>