/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/test/test2.php
ViewVC logotype

Contents of /nfo/php/libs/com.newsblob.phphtmllib/test/test2.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Fri Sep 19 22:49:58 2003 UTC (20 years, 9 months ago) by jonen
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +16 -16 lines
+ updated whole phphtmllib to v2.3.0

1 <?php
2
3 include_once("localinc.php");
4
5 $page = new HTMLPageClass("Test script #2");
6
7 $style = new STYLEtag();
8 $style->add( "
9 TABLE.frame {
10 background:#000000;
11 font-size:10pt;
12 }
13 TD.head {
14 font-family:arial,helvetica,lucida;
15 font-size:11pt;
16 font-weight:bold;
17 background:#6b6b6b;
18 color:#ffffff
19 }
20 TD.head2 {
21 font-family:arial,helvetica,lucida;
22 font-size:10pt;
23 font-weight:bold;
24 background:#6b6b6b;
25 color:#000000;
26 }
27 TR.cell1 {
28 background:#eff1ff;
29 font-size:10pt;
30 }\n");
31
32 //Add the raw style tag and content
33 //to the <head> of the page.
34 $page->add_head_content( $style );
35
36
37
38 $attributes = array("width"=>"300",
39 "border"=>0,
40 "cellspacing"=>0,
41 "cellpadding"=>1);
42 $table = new TABLEtag( $attributes );
43
44 $tr = new TRtag();
45 $tr2 = new TRtag();
46 $td = new TDtag( array("class"=>"head") );
47 $td2 = new TDtag;
48
49 $title_table = new TABLEtag( array("width"=>"100%",
50 "border"=>0,
51 "cellspacing"=>0,
52 "cellpadding"=>2,
53 "class"=>"frame") );
54 $td->add( "Some Title Here" );
55 $title_table->add_row( $td );
56
57
58 $td2->set_tag_attributes( array("valign"=>"top", "class"=>"head") );
59 $td2->add( $title_table );
60 $table->add_row( $td2 );
61
62 $content_table = new TABLEtag;
63 $content_table->set_tag_attributes( array("width"=>"100%", "border"=>0,
64 "cellspacing"=>1, "cellpadding">=1) );
65
66 $tr->set_tag_attributes( array("class" => "cell1") );
67
68 //set all of the td's that get created in
69 //tr's add function to have attributes of
70 //allign=center
71 $tr->set_default_td_attributes(array("align"=>"center"));
72
73 $center = new Ptag();
74
75 $str = "some example string";
76 $center->add( $str, html_br(), html_br() );
77 $center->add( $str, html_br(), html_br() );
78 $center->add( $str );
79 $tr->add( $center );
80
81 $tr->add( html_p( "Some lame stuff", html_br(), html_br(),
82 "some more stuff", html_br(), html_br(),
83 "and even more") );
84
85 $content_table->add_row( $tr );
86
87 $td2 = new TDtag( array( "class" => "head2") );
88
89 $td2->add( $content_table );
90
91 $table->add_row( $td2 );
92
93 $page->add( $table );
94
95 print $page->render();
96 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed