PHP Class for Generating HTML Tables

The PHP Table Class is a basic class for generating html tables. It is useful for separating logic from markup and keeping code cleaner when outputting mysql query results or displaying elements of arrays. It works nicely in combination with the PHP Form Class.

The PHP Table Class provides methods for adding not only table rows and cells, but also caption, colgroup, col, thead, tfoot, and tbody elements. Convenient, easy to use methods provide named arguments for the most common attributes and allow the addition of any number of optional attributes using associative array syntax.

More Information

See an example demonstrating the methods used to generate a table for display of PHP array content. The documentation provides more details about the PHP table class methods. A download provides examples and the class file. Also, the PHP Table Class file is available for viewing online.