Draw relational table diagram in SVG using PHP

hi experts …

I am trying to code a php svg script, that will draw the table relational diagram in SVG XML … I tried a lot of books,tutorials etc

I need the suggestion that how I should draw a table diagram and how I should calculate the length of the text element ?

Not sure if it will help, but I think you should look at Raphael.

Thanks for Quick Response !!

how it will be easy in JS ? what I want is to know how or what will be XML code for drawing table and to know the length of the text. So, I could draw table cells …

Also, how to draw cells like a a table …

Would probably be easier to write this in javascript.
Encode the data in json, and have the javascript run through and build up the SVG.

Calculating pixel lengths of text could be done with getBBox() method.