Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
7.phpt: 3 row 3 column, getCellAttributes / getRowAttributes
3
--FILE--
4
<?php
5
// $Id: 7.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" align = "right"');
21
}
22
 
23
// This overwrites attrs thus removing align="right"
24
$table->setColAttributes(0, 'bgcolor = "purple"');
25
// This updates attrs, change bgcolor, but in tr
26
$table->updateRowAttributes(2, 'bgcolor = "blue"', true);
27
 
28
// output
29
// row 2, cell 2
30
var_dump($table->getCellAttributes(2, 2));
31
var_dump($table->getRowAttributes(2));
32
?>
33
--EXPECT--
34
array(2) {
35
  ["bgcolor"]=>
36
  string(6) "yellow"
37
  ["align"]=>
38
  string(5) "right"
39
}
40
array(1) {
41
  ["bgcolor"]=>
42
  string(4) "blue"
43
}