title: Split table in php
body: <p>i got this script. it looks into a file and read all the lines and put it nicely in a table.. what i need to do now is to take all the table data and split it into two tables .. </p>
  
  <p>eg. if their is 100 rows.. then instead of one long list, i will get 50 data in one table and the other 50 in the other table... </p>
  
  <pre><code>  enter code here&lt;?php
      if(isset ($_GET['type'])) 
      {
          $otype = $_GET['type'];
      } 
      else 
      {
          $otype = 'm';
      }
  
      $statusFile = "d:\\CLIENTS\\status.txt";
  
      $file_handler = fopen($statusFile, "r"); 
  
      // read the contents 
      $contents = fread($file_handler, filesize($statusFile)); 
  
      // close the file 
      fclose($file_handler); 
  
      if (strcasecmp($otype, "m") == 0)
      {
          echo $contents;  
      } 
      else 
      {
          $lines = explode("\n",$contents);
          $frow = explode(",", $lines[0]);
  
          if (strcmp($frow[1],"1") == 0) 
          {
              echo "Update Status: &lt;b&gt;Complete&lt;/b&gt;";
              //to count total lines in txt file
              $statusFile = "d:\\CLIENTS\\status.txt";
              $line = count(file($statusFile)); 
              echo "There are".$line."lines in"; 
          } 
          else 
          {
              echo "Update Status: &lt;b&gt;Incomplete&lt;/b&gt;";
          }
  
          echo "&lt;table border=\"1\"&gt;";
          for ($count = 1; $count &lt; sizeof($lines); $count++) 
          {
              $fields = explode(",",$lines[$count]);
              $sz = sizeof($fields);
              if ($sz &gt; 1) 
              {
                  $str = "OK";
                  echo "&lt;tr&gt;";
                  echo "&lt;td&gt;" . $fields[0] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $fields[1] . "&lt;/td&gt;";
                  //echo "&lt;td&gt;" . $fields[2] . "&lt;/td&gt;";
  
                  if (strpos($fields[2],'OK') !== false) 
                  {
                      echo "&lt;td&gt;&lt;font color='green'&gt;". $fields[2] ."&lt;/font&gt;&lt;/td&gt;";
  
                      //echo "&lt;td style='background-color: #00FF00;'&gt;". $fields[2] ."&lt;/td&gt;"; 
                  } 
                  else 
                  {
                      //echo "&lt;td&gt;&lt;font color='red'&gt;". $fields[2] ."&lt;/font&gt;&lt;/td&gt;";
                      echo "&lt;td style='background-color: #FF0000;'&gt;". $fields[2] ."&lt;/td&gt;"; 
                  }
  
  
              echo "&lt;/tr&gt;";
  
          }
      }
          echo "&lt;/table&gt;";
  }
  ?&gt;
  </code></pre>