Thread: using HTML tabular output

using HTML tabular output

From
Murat Balkas
Date:
Hi,
 I'm trying to design a web page which will show the results of a query. I
think, using HTML tabular output would be nice. But I don't know how to
change the output style from pgtclsh.

 My environment :

 I'm using postgresql 6.4, cgi.tcl-0.7 from Libes, and pgtclsh. I can use
all tcl commands. I need help on getting the result of a query in HTML
output. So :

 set conn [pg_connect $databasename]
 set query "select * from services;"
 set r [ pg_exec $conn $query]
 set r1 [ pg_result -getTuple 0]

Here, $r1 should be in HTML format like,

<table ><caption align=high>Retrieved 2 rows * 9 fields</caption>
<tr><th align=right>seq</th><th align=left>name</th><th
align=left>subject</th><th align=left>type</th><th
align=left>urgency</th><th align=left>problem</th><th
align=right>solution</th><th align=right>comment</th><th
align=right>solver</th></tr>
...

Or I need smth. like that.

Thanks for your help.

P.S. : I'm sorry for my poor english.

Murat