website/lib/table.php
2000-11-13 17:55:00 +00:00

131 lines
2.7 KiB
PHP

<?
/*
table.php
Table function library
Copyright (C) 2000 Contributors of the QuakeForge Project
Please see the file "AUTHORS" for a list of contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
*/
have ('table');
/*
tableBoxHeader
Begin a bordered table
*/
function tableBoxHeader ($bgColor, $borderColor)
{
echo '<TABLE cellSpacing="0" cellPadding="1" width="100%" border="0" bgColor="' . $borderColor . '">' .
' <TR>' .
' <TD>' .
' <TABLE cellSpacing="1" cellPadding="2" width="100%" border="0" bgColor="' . $bgColor . '">';
}
/*
tableBoxFooter
Finish an opened bordered table
*/
function tableBoxFooter ()
{
echo ' </TABLE>' .
' </TD>' .
' </TR>' .
'</TABLE>';
}
/*
tableHeader
Begin an unbordered table
*/
function tableHeader ($width, $bgColor)
{
echo '<TABLE cellSpacing="0" cellPadding="0" width="' . $width . '" border="0" bgColor="' . $bgColor . '">';
}
/*
tableFooter
Close an unbordered table
*/
function tableFooter ()
{
echo '</TABLE>';
}
/*
*/
function tableColumnStart ($align, $colSpan)
{
echo '<TD align="' . $align . '" colSpan="' . $colSpan . '">';
}
/*
*/
function tableColumnEnd ()
{
echo '</TD>';
}
/*
*/
function tableRowStart ($vAlign)
{
echo '<TR vAlign="' . $vAlign . '">';
}
/*
*/
function tableRowEnd ()
{
echo '</TR>';
}
/*
tableSpacer
Display a scaled transparent spacer image inside a table heading
*/
function tableSpacer ($width, $height, $cols, $bgColor)
{
echo '<TH colSpan="' . $cols . '" width="' . $width . '" bgColor="' . $bgColor . '">' .
' <IMG src="/img/blank.gif" height="' . $height . '" width="' . $width . '" border="0" alt="">' .
'</TH>';
}
/*
tableTitle
Display a colored title in a BoxTable.
*/
function tableTitle ($name, $cols, $bgColor)
{
echo ' <TR bgColor="' . $bgColor . '" align="center">' .
' <TH colspan="' . $cols . '">' .
' <SPAN class="titleBar">' . $name . '</SPAN>' .
' </TH>' .
' </TR>';
}
?>