HI,
I am trying to create a PHP data grid - which accesses the database - retrieves data fields and data and prints out as a grid.
here the syntax in
<table>
<header row>Header</header row>
<data row colspan='num of fields'>
<div>
<inner table with data>
</div>
</data row>
</table>
The reason for having a DIV is to later use AJAX for inline editing of the row - the problem(s)
- column width of outer table - can't use absolute values since data size varies
- even if I calculate the length of data for a specific field and then set the width - it doesn't respect it
- some of the database tables are many fields (as many as 71)
- tables are declared as <table width='100%' cellpadding=0 cellspacing=0>
what am i missing here ?
Dynamic HTML Table Generation with PHP
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Dynamic HTML Table Generation with PHP
What is your question? It seems to be something about widths.
(#10850)
Re: Dynamic HTML Table Generation with PHP
precisely - the problem with width in the inner table
i want them to be same as the header created in the outer table
attaching the screen shot below:
i want them to be same as the header created in the outer table
attaching the screen shot below:
- Attachments
-
- forum_pic.JPG (51.02 KiB) Viewed 875 times
Re: Dynamic HTML Table Generation with PHP
There are just dozens and dozens of php data grid scripts available (try hotscripts.com, for example) and they use many different approaches to display the results. You would do well to download several of these and examine their code.
Re: Dynamic HTML Table Generation with PHP
This is ridiculously simple...
If you do it like that, the columns WILL align.
Code: Select all
<table>
<tr>
<td>c1</td><td>c2</td><td>c3</td>
</tr>
while(){
<tr>
<td>c1data</td><td>c2data</td><td>c3data</td>
</tr>
}
</table>Re: Dynamic HTML Table Generation with PHP
well - i now that - but data row is in different table -Attilitus wrote:This is ridiculously simple...
If you do it like that, the columns WILL align.Code: Select all
<table> <tr> <td>c1</td><td>c2</td><td>c3</td> </tr> while(){ <tr> <td>c1data</td><td>c2data</td><td>c3data</td> </tr> } </table>