Login   Register  
PHP Classes
elePHPant
Icontem

File: table.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of sun yundong  >  table  >  table.php  >  Download  
File: table.php
Role: ???
Content type: text/plain
Description: out put a table
Class: table
Author: By
Last change:
Date: 13 years ago
Size: 1,947 bytes
 

Contents

Class file image Download
class style
{ 
	var $text;
	var $alink;
	var $vlink;
	var $link;
	var $bgcol;
	var $face;
	var $size;
	var $align;
	var $valign;
  function style($text="#000000",$alink="#aaooaa",$vlink="#aa00aa",$link="#3333ff",$bgcol="#999999",
	                  $face="verdana",$size=3,$align="center",$valign="top")
	                {
	                  $this->text=$text;
					  $this->alink=$alink;
					  $this->vlink=$vlink;
					  $this->link=$link;
					  $this->bgcol=$bgcol;
					  $this->face=$face;
					  $this->size=$size;
					  $this->align=$align;
					  $this->valign=$valign;
                     }
 function set($var,$value)
                      {
			          $this->$var=$value;
		              }
 function body()
	                 {
	                  print"<body bgcolor=\"$this->bgcol\"";
					  print"text=\"$this->text\""."link=\"$this->link\"><font ". "face=\"$this->face\" size=\"$this->size\">\n";
                      }
function textout($message="&nbsp")
	                  {
						  print "<font face=\"$this->face\" color=\"$this->text\" size=$this->size > $message </font>\n";
					   }
function tdout($mess="&nbsp",$colspan=1,$bgcol="#ffffff")
	                   {
	                    print"<td colspan=$colspan bgcolor=$bgcol";
						print"align=\"$this->align\" valign=\"$this->valign\">";
						$this->textout($mess);
						print"</td>\n";
						}
function trout($message="&nbsp")
	                   {
	                    print"<tr>\n";
						$cell=explode("|",$message);
						$cellcount=count($cell);
						$i=0;
						while($i<$cellcount)
						   {
							list($message,$span)=explode(":",$cell[$i]);
							    if (strlen($message)<1)
									$message="&nbsp";
							if ($span)
							   {
								$this->tdout($message,$span);
							   }
							else 
							   {$this->tdout($message);}
							$i++;
						    }
						print"</td>\n";
						}
}