1<?php 2/******************************** 3OSBib: 4A collection of PHP classes to create and manage bibliographic formatting for OS bibliography software 5using the OSBib standard. 6 7Released through http://bibliophile.sourceforge.net under the GPL licence. 8Do whatever you like with this -- some credit to the author(s) would be appreciated. 9 10If you make improvements, please consider contacting the administrators at bibliophile.sourceforge.net 11so that your improvements can be added to the release package. 12 13Adapted from WIKINDX: http://wikindx.sourceforge.net 14 15Mark Grimshaw 2005 16http://bibliophile.sourceforge.net 17********************************/ 18/** 19* HTML TABLE elements 20* 21* @author Mark Grimshaw 22* 23* $Header: /cvsroot/bibliophile/OSBib/create/TABLE.php,v 1.1 2005/06/20 22:26:51 sirfragalot Exp $ 24*/ 25class TABLE 26{ 27// constructor 28 function TABLE() 29 { 30 } 31// code for starting a table 32 function tableStart($class = FALSE, $border = 0, $spacing = 0, $padding = 0, $align = "center", $width="100%") 33 { 34 $string = <<< END 35<table class="$class" border="$border" cellspacing="$spacing" cellpadding="$padding" align="$align" width="$width"> 36END; 37 return $string . "\n"; 38 } 39// code for ending a table 40 function tableEnd() 41 { 42 $string = <<< END 43</table> 44END; 45 return $string . "\n"; 46 } 47// return properly formatted <tr> start tag 48 function trStart($class = FALSE, $align = "left", $vAlign = "top") 49 { 50 $string = <<< END 51<tr class="$class" align="$align" valign="$vAlign"> 52END; 53 return $string . "\n"; 54 } 55// return properly formatted <tr> end tag 56 function trEnd() 57 { 58 $string = <<< END 59</tr> 60END; 61 return $string . "\n"; 62 } 63// return properly formatted <td> tag 64 function td($data, $class = FALSE, $align = "left", $vAlign = "top", $colSpan = FALSE, $width=FALSE) 65 { 66 $string = <<< END 67<td class="$class" align="$align" valign="$vAlign" colspan="$colSpan" width="$width"> 68$data 69</td> 70END; 71 return $string . "\n"; 72 } 73// return start TD tag 74 function tdStart($class = FALSE, $align = "left", $vAlign = "top", $colSpan = FALSE) 75 { 76 return "<td class=\"$class\" align=\"$align\" valign=\"$vAlign\" colspan=\"$colSpan\">\n"; 77 } 78// return td end tag 79 function tdEnd() 80 { 81 return "</td>\n"; 82 } 83} 84?> 85