Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 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
?>