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.

Demo, Download, Documentation, and More

View the PHP Table Class file as well as an example demonstrating its use. A download file includes the PHP Table Class file and examples. Documentation is also provided.

See the PHP Form Class which is well suited for use with the PHP Table Class. See also the PHP Order Form for a demonstration of the PHP Table Class used in combination with the PHP Form Class.