Zend Certified Engineer

phpguru.org

Quality PHP and Javascript code
Download RGraph: HTML5 canvas graph library... Home ~ Downloads ~ FAQs ~ Licensing
RSS Feed RSS Feed
Follow me on Twitter Follow me on Twitter

Add to Google...

HTML5 & CSS3

Articles

Javascript

PHP5

PHP4






Bookmark with delicious tweet this site Post to Google Buzz! Stumble! this site

Console Table class

A class for building console/ASCII based tables (like the ones the MySQL client produces). Has Append/Prepend/Insert methods and supports table headers and footers. Automatically handles setting the correct widths for columns.

Example

ConsoleTable table = new ConsoleTable();

table.AppendRow(new string[] {"foo", "bar", "jello"});
table.AppendRow(new string[] {"foo", "bar", "jello"});
table.AppendRow(new string[] {"foo", "bar", "jello"});
table.AppendRow(new string[] {"foo", "bar", "jello"});

table.SetHeaders(new string[] {"First Column", "Second Column", "Third Column"});
table.SetFooters(new string[] {"Yabba"});

table.InsertRow(new string[] {"", "ferfr", "frf        r"}, 7);
table.PrependRow(new string[] {});

System.Console.Write(table.ToString());

Produces...

+--------------+---------------+--------------+
| First Column | Second Column | Third Column |
+--------------+---------------+--------------+
|              |               |              |
| foo          | bar           | jello        |
| foo          | bar           | jello        |
| foo          | bar           | jello        |
| foo          | bar           | jello        |
|              |               |              |
|              |               |              |
|              |               |              |
|              | ferfr         | frf        r |
+--------------+---------------+--------------+
| Yabba        |               |              |
+--------------+---------------+--------------+

Download now



RGraph: HTML5 canvas graph library

Example graph made using RGraph

If you're interested in web development, then you may also be interested in RGraph: HTML5 canvas graph library. It uses HTML5 features to produce a wide variety of graph types. Because it moves the creation of graphs from the server to the client, it can significantly reduce the load on your server and your bandwidth usage.