Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
14.phpt: 3 row 3 column, setColCount / getColCount / setRowCount / getRowCount
3
--FILE--
4
<?php
5
// $Id: 14.phpt 297540 2010-04-05 19:58:39Z wiesemann $
6
require_once 'HTML/Table.php';
7
$table = new HTML_Table('width="400"');
8
 
9
$data[0][] = 'Foo';
10
$data[0][] = 'Bar';
11
$data[0][] = 'Test';
12
$data[1][] = 'Foo';
13
$data[1][] = 'Bar';
14
$data[1][] = 'Test';
15
$data[2][] = 'Foo';
16
$data[2][] = 'Bar';
17
$data[2][] = 'Test';
18
 
19
foreach($data as $key => $value) {
20
    $table->addRow($value, 'bgcolor = "yellow"');
21
}
22
 
23
echo $table->getRowCount() . "\n";
24
echo $table->getColCount() . "\n";
25
 
26
echo $table->setRowCount(2);
27
echo $table->setColCount(2);
28
 
29
echo $table->getRowCount() . "\n";
30
echo $table->getColCount() . "\n";
31
 
32
// output
33
echo $table->toHTML();
34
?>
35
--EXPECT--
36
3
37
3
38
2
39
2
40
<table width="400">
41
	<tr>
42
		<td bgcolor="yellow">Foo</td>
43
		<td bgcolor="yellow">Bar</td>
44
	</tr>
45
	<tr>
46
		<td bgcolor="yellow">Foo</td>
47
		<td bgcolor="yellow">Bar</td>
48
	</tr>
49
</table>