PHP Classes

finetable: Panels with rounded corners

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2003-03-22 (12 years ago) RSS 2.0 feedStarStarStar 59%Total: 2,515 All time: 1,458 This week: 1,395Up
Version Licenses Categories  
finetable 1.0Freely DistributableHTML
Description Author  

finetable.php is a PHP3/4 - script including all elements needed to build a table with rounded corners within itself. Two image files can be generated automatically, if there is write permission on your site.
If not, download the rescue pack which contains the transparent gif and the corner producing php script.

Picture of Peter Klauer
Name: Peter Klauer <contact>
Classes: 18 packages by
Country: Germany Germany
Age: 57
All time rank: 302 in Germany Germany
Week rank: 182 Down6 in Germany Germany Down
Innovation award
Innovation award
Nominee: 3x

finetable readme.txt
April 6, 2002

finetable.php is used to produce panels with rounded corners.
It contains the class ftable, which simplifies the calls to
the finetable functions.

To use finetable.php in your php files you include it like this:

     include 'finetable.php';
This includes all imperative functions and the class "ftable".
Now both the imperative and the object oriented ways are open.

If you already included an older version and you did include
the class wrapper file, too: Delete the line including the class wrapper:

    include 'ft_class.php'; // <-- Delete this line, it is depreciated

Everything will work as before. If you do not delete this line,
an error will occur.
You can put the image delivering files into an extra image
directory, maybe "images". Change these lines after the big comment
in finetable.php:

    $me = 'images/'.IMAGE_GENERATOR;
    $blank = 'images/'.BLANK_IMAGE;

If the files needed to produce the corners and the transparent image
are not there, they will be created if there is write permission.
You can hide the files away from the http: path and put them
somewhere in the directory structure of your server:

    $me = '/usr/local/http/includes/'.IMAGE_GENERATOR;
    $blank = '/usr/local/http/includes/images/'.BLANK_IMAGE;

You can rename the files within these define statements:

    define ( 'IMAGE_GENERATOR', 'ft_img2.php' );
    define ( 'BLANK_IMAGE', 'ft_blank.gif' );
Finetable will create the files if write permission is given.
If the files are not created, check if the path exists and if you
can get write permission for the path specified.
Check for spelling errors.

You can easily determine if the files are created or not:
look at the corners of the generated panels. If the panels look ok
then the files were created. If the panels look wired, then something
is wrong. 

Download the rescue pack to get the 2 files, if
writing the files does not work.     
The class wrapper was added to simplify the approach to finetable
calls. To surround large blocks of code with a finetable, it is
easier to use the class than the pure imperative method.

Here I surround a lot of code with the imperative method:
    echo ft_upperhalf( 'Links to pages which use <b>finetable.php</b>', 
         '000000',1,12,'100%','FFCC00','','FFEE00' ); 
    ... <a lot of code > ...
    ... at this point, after more than a screen full with code, I
    ... need to scroll up: huh, what was the color? The radius?
    ... now i scroll down again and put this:
    echo ft_lowerhalf( 12, 'FFCC00' ); // End of outer Table.         
Using the class this would look like this:

    $outer = new ftable;
    $outer->bodybgcolor = 'FFCC00';
    $outer->captionbgcolor = 'FFEE00';
    $outer->linecolor = '000000';    
    $outer->caption = 'Links to pages which use <b>finetable.php</b>';
    ... <a lot of code > ...
    ... at this point, after more than a screen full with code, 
    ... I do not bother at all what was written above. I put this:
Using the class method, a panel can be drawn quickly with:

    $panel = new ftable;

This panel is not empty. It has a caption "Untitled" and a
body who calls "Please give me content!". The corners have
a radius of 12 and the panel's width is '100%'. The colour
is white and the line separating caption and body is one
pixel high and maroon.
To put another caption write:

    $panel->caption = 'This is another caption';

The same ftable-object can be drawn as often as you like.
Now lets put some other text into the panel:

    $panel->bodytext = 'Finally, I have content.';

You can go on and modify all other values. Change the background
colour of the caption with

    $panel->captionbgcolor = '00FFFF'; // cyan
Every variable needed has a default value. The defaults are:

    var $captiontext = 'Untitled'; // some text
    var $captionbgcolor = 'FFFFFF'; // white
    var $bodytext = 'Please give me content!'; // some more text
    var $bodybgcolor = 'FFFFFF'; // white
    var $linecolor = '800000'; // maroon
    var $lineheight = 1;
    var $width = '100%';
    var $radius = 12;
    var $summary = ''; // <table> - summary needed for blind people
The colours must be given in a hex-string as shown above. It is 
NOT possible to use 'white' instead of 'FFFFFF'. 
To find out color values you can use my "Farbmischer" (colour mixer) at

If you followed the above example you noticed, that all panels
hang together. A separating space would be fine. A <br> tag often
is too fat. In finetable.php, there are two functions for that.
ft_blank( $width, $height) generates a string calling the image defined
in $blank. blanker( $width, $height ) echoes this string immediately.
To have vertically separated panels in the example from above, write:
    include 'finetable.php';

    $panel = new ftable;
    blanker( 100,4 );
    $panel->caption = 'This is another caption';
    blanker( 100,4 );
    $panel->bodytext = 'Finally, I have content.';
    blanker( 100,4 );    
    $panel->captionbgcolor = '00FFFF'; // cyan
    $panel->width = '50%';

I hope this informations concerning finetable are useful.

Knito, April 8, 2002    
  Files folder image Files  
File Role Description
Plain text file finetable.php Class Panels with rounded corners
Accessible without login Plain text file readme.txt Doc. Some Infos about using finetable
Accessible without login Plain text file test_finetable.php Example used to test finetable, demo

 Version Control Unique User Downloads Download Rankings  
 0%Total:2,515All time:1,458
 This week:0This week:1,395Up
 User Ratings  
 All time