Location: PHPKode > scripts > phpTable > phptable/example.php
<? include ("class.phpTable.php"); ?>


   <? $myTable = new phpTable(); ?>
   <? $myTable->setProperty("tableID", "myTable");
      $myTable->setProperty("width", "400");
      $myTable->setProperty("border", "1");
      $myTable->setProperty("borderColor", "");
      $myTable->setProperty("cellPadding", "2");
      $myTable->setProperty("cellSpacing", "2");
      $myTable->setProperty("align", "left");
      $myTable->setProperty("styleClass", "tableClass");

      /* Only set the values you *need*
         The class will adjust itself for null values. */

   ?>




   <? $myTable->beginTable(); ?>

      <? $myTable->beginRow(); ?>



         <? $myTable->beginCell("firstCell", "#eeeeee", "", "200", "75", "center", "middle", "", "", ""); ?>

            This is my first cell.

         <? $myTable->endCell(); ?>



         <? $myTable->beginCell("secondCell", "#dddddd", "", "200", "75", "center", "middle", "", "", ""); ?>

            This is my second cell.

         <? $myTable->endCell(); ?>



      <? $myTable->endRow(); ?>
      <? $myTable->beginRow(); ?>



         <? $myTable->beginCell("thirdCell", "#cccccc", "", "400", "125", "center", "middle", "2", "", ""); ?>

            This is my third cell.

         <? $myTable->endCell(); ?>


      <? $myTable->endRow(); ?>


   <? $myTable->endTable(); ?>

Return current item: phpTable