HTML_Table
[ class tree: HTML_Table ] [ index: HTML_Table ] [ all elements ]

Source for file Table_example2.php

Documentation is available at Table_example2.php

  1. <?php
  2.  
  3. /*
  4. * This example will output html websafe colors in a table
  5. * using HTML_Table.
  6. */
  7. // $Id: Table_example2.php 297540 2010-04-05 19:58:39Z wiesemann $
  8.  
  9. require_once 'HTML/Table.php';
  10.  
  11. $table = new HTML_Table('width = "100%"');
  12. $table->setCaption('256 colors table');
  13. $i $j = 0;
  14. for ($R = 0; $R <= 255; $R += 51{
  15.     for ($G = 0; $G <= 255; $G += 51{
  16.         for($B = 0; $B <= 255; $B += 51{
  17.             $table->setCellAttributes($i$j'bgcolor = "#'.sprintf('%02X%02X%02X'$R$G$B).'"');
  18.             $j++;
  19.         }
  20.     }
  21.     $i++;
  22.     $j = 0;
  23. }
  24. echo $table->toHtml();
  25. ?>

Documentation generated on Mon, 11 Mar 2019 15:36:59 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.