Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
17.phpt: 3 row 2 column, setCaption
3
--FILE--
4
<?php
5
// $Id: 17.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][] = 'Test';
10
$data[0][] = 'Test';
11
$data[1][] = 'Test';
12
$data[1][] = 'Test';
13
$data[2][] = 'Test';
14
$data[2][] = 'Test';
15
 
16
foreach($data as $key => $value) {
17
    $table->addRow($value, 'bgcolor = "yellow" align = "right"');
18
}
19
 
20
$table->setColType(0, 'TH');
21
$table->setRowType(1, 'TD');
22
$table->setRowType(2, 'TH');
23
 
24
// output
25
echo $table->toHTML();
26
?>
27
--EXPECT--
28
<table width="400">
29
	<tr>
30
		<th bgcolor="yellow" align="right">Test</th>
31
		<td bgcolor="yellow" align="right">Test</td>
32
	</tr>
33
	<tr>
34
		<td bgcolor="yellow" align="right">Test</td>
35
		<td bgcolor="yellow" align="right">Test</td>
36
	</tr>
37
	<tr>
38
		<th bgcolor="yellow" align="right">Test</th>
39
		<th bgcolor="yellow" align="right">Test</th>
40
	</tr>
41
</table>