1 <?php
2 /********************************
3 OSBib:
4 A collection of PHP classes to create and manage bibliographic formatting for OS bibliography software
5 using the OSBib standard.
6 
7 Released through http://bibliophile.sourceforge.net under the GPL licence.
8 Do whatever you like with this -- some credit to the author(s) would be appreciated.
9 
10 If you make improvements, please consider contacting the administrators at bibliophile.sourceforge.net
11 so that your improvements can be added to the release package.
12 
13 Adapted from WIKINDX: http://wikindx.sourceforge.net
14 
15 Mark Grimshaw 2005
16 http://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 */
25 class 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">
36 END;
37 		return $string . "\n";
38 	}
39 // code for ending a table
40 	function tableEnd()
41 	{
42 		$string = <<< END
43 </table>
44 END;
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">
52 END;
53 		return $string . "\n";
54 	}
55 // return properly formatted <tr> end tag
56 	function trEnd()
57 	{
58 		$string = <<< END
59 </tr>
60 END;
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>
70 END;
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