I had the same clear mind while writing displayserver. I chose to use javascript. The cgi-part just streams out javascript arrays, which get prepended to an HTML-file. Use a loop in javascript to create tables and you're finished.
_________________________
Frank van Gestel