PHP Classes
Icontem

File: DIVBasedTable.inc.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Muhammad Arfeen  >  DIV Based Table Generator  >  DIVBasedTable.inc.php  
File: DIVBasedTable.inc.php
Role: Class source
Content type: text/plain
Description: Main Class
Class: DIV Based Table Generator
Generate table like HTML layouts using only DIVs
 

Contents

Class file image Download
<?php

/*
This DIVBasedTable.inc.php can be used to make DIV based simple tables with additional
user defined inline style sheets. Steps are shown for a sample DIV based table design.

Written by: Muhammad Arfeen

*/

class DIVBasedTable {

    

        function 
DIVBasedTable($TableCaption="") {
            
                
$this->TableBackGroundColor="";
                
$this->TableBorderColor="";
                
$this->TableBorder="";
                
$this->TableWidth;        
                
$this->TableWidthCol;
                
$this->TableWidthColNo;
                
$this->HeaderCellStyle;
                
$this->BodyRowCellStyle;
                
$this->TableRowStyle;
            
#    $this->FinalTable = $this->GetCSS();
                    
                
        
        
}
        
        function 
StartTable($TableAlign="center") {
            
                            
$this->FinalTable .= "<DIV class='base-layer' align=\"$TableAlign\"> ";        
                            
        }
        
        function 
StartHeader($HeaderRowID="",$Style="",$TableAlign="center") {
            
                            
$this->FinalTable .= "<div class='MyTableRowClass' ID='$HeaderRowID'  align=\"$TableAlign\"> ";                        
                            
        }
        
        function 
AddHeaderCell($HeaderText="AddColumn",$Style="",$TableAlign="center") {
            
                            
$this->FinalTable .= "<div class='MyMainTableRowClass' style='$Style' align=\"$TableAlign\"><h5 class='MyTableHeaderClass'>";
                            
$this->FinalTable .= $HeaderText "</h5></DIV>";
                            
        }
        
        function 
StopHeader(){
            
                            
$this->FinalTable .= "</DIV>";
        }
        
        function 
StartTableRow($BodyRowID="",$Style="",$TableAlign="center") {
            
                
$this->FinalTable .= "<div class='MyTableRowClass' ID='$BodyRowID' style='$Style' align=\"$TableAlign\"> ";        
                
        }
        
        function 
AddBodyCell($HeaderText="BodyCell",$Style="") {
            
                            
$this->FinalTable .= "<div class='MyMainTableRowClass' style='$Style' align=\"$TableAlign\"><P class='MyTableCellTextClass'>";
                            
$this->FinalTable .= $HeaderText "</P></DIV>";
                            
        }
        
        function 
StopTableRow(){
            
                            
$this->FinalTable .= "</DIV>";
        }
        
        function 
CloseTable(){
            
                            
$this->FinalTable .= "</DIV>";
        }
        
        function 
GetFinalTable(){
            
            return 
$this->FinalTable;
            
        }
        
        function 
GetCSS() {
            
            
            
$this->TableWidthCol =  sprintf("%d",$this->TableWidth $this->TableWidthColNo) . "%";
            
            
$this->FinalTable .= "<style>
             DIV.base-layer {
   border: solid #f8f8f8 1px; 
  "
.$this->TableStyle."; padding: 0; text-align: center; width: auto; 
}

DIV.MyTableRowClass {
   width: "
.$this->TableWidth."; 
}


DIV.MyMainTableRowClass {
  float: left; margin: 0; padding: 0; width: "
.$this->TableWidthCol."; ".$this->TableRowStyle."
}


H5.MyTableHeaderClass {
  "
.$this->HeaderCellStyle."
}

P.MyTableCellTextClass {
  "
.$this->BodyRowCellStyle."
}


</style>
"
;
        
        
            
        }
        
        


};


?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products