Skip to content
Newer
Older
100755 69 lines (64 sloc) 1.22 KB
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored Nov 27, 2005
1 --TEST--
2 26.phpt: thead, tfoot, tbody with mixed function calls
3 --FILE--
4 <?php
5 // $Id$
6 require_once 'HTML/Table.php';
e1c7a95 - Request #16984: added a __toString() method, i.e. "echo $table;" is…
Mark Wiesemann authored Apr 5, 2010
7 $table = new HTML_Table('width="400"');
55664eb tests for thead/tfoot/tbody support
Mark Wiesemann authored Nov 27, 2005
8
9 $thead =& $table->getHeader();
10 $tfoot =& $table->getFooter();
11 $tbody =& $table->getBody();
12
13 $thead->setHeaderContents(2, 2, 'some th content', 'bgcolor="red"');
14 $tfoot->setHeaderContents(1, 1, 'another th content', 'bgcolor="yellow"');
15
16 $data[0][] = 'Test';
17 $data[1][] = 'Test';
18
19 foreach($data as $key => $value) {
20 $tbody->addRow($value, 'bgcolor="darkblue"');
21 }
22
23 // output
24 echo $table->toHTML();
25 ?>
26 --EXPECT--
27 <table width="400">
28 <thead>
29 <tr>
30 <td>&nbsp;</td>
31 <td>&nbsp;</td>
32 <td>&nbsp;</td>
33 </tr>
34 <tr>
35 <td>&nbsp;</td>
36 <td>&nbsp;</td>
37 <td>&nbsp;</td>
38 </tr>
39 <tr>
40 <td>&nbsp;</td>
41 <td>&nbsp;</td>
42 <th bgcolor="red">some th content</th>
43 </tr>
44 </thead>
45 <tfoot>
46 <tr>
47 <td>&nbsp;</td>
48 <td>&nbsp;</td>
49 <td>&nbsp;</td>
50 </tr>
51 <tr>
52 <td>&nbsp;</td>
53 <th bgcolor="yellow">another th content</th>
54 <td>&nbsp;</td>
55 </tr>
56 </tfoot>
57 <tbody>
58 <tr>
59 <td bgcolor="darkblue">Test</td>
60 <td>&nbsp;</td>
61 <td>&nbsp;</td>
62 </tr>
63 <tr>
64 <td bgcolor="darkblue">Test</td>
65 <td>&nbsp;</td>
66 <td>&nbsp;</td>
67 </tr>
68 </tbody>
69 </table>
Something went wrong with that request. Please try again.