|
-
Mar 2nd, 2006, 01:54 AM
#1
Thread Starter
Frenzied Member
Table stuctures
Have searched!
I need an html table built wondering if anybody has a link and some code for this, have 5 incoming variables and want to display them in a fixed table, i also need 7 headers for that table.
if you have any suggestions then tia.
-
Mar 2nd, 2006, 02:31 AM
#2
Member
Re: Table stuctures
You could make a skin/templet:
Example:
PHP Code:
function table_header(){
$html = "<table><tr>"
$html .= "<td>Col 1</td><td>Col 2</td><td>Col 3</td>";
$html .= "<td>Col 4</td><td>Col 5</td><td>col 6</td>"
$html .= "<td>col 7</td>";
$html .= "</tr>";
return $html;
}
function row($var1="",$var2="",$var3="",$var4="",$var5="",$var6="",$var7=""){
$html = "<tr>"
$html .= "<td>" . $var1 . "</td><td>" . $var2 . "</td><td>" . $var3 . "</td>";
$html .= "<td>" . $var4 . "</td><td>" . $var5 . "</td><td>" . $var6 . "</td>."
$html .= "<td>" . $var7 . "</td>"
$html .= "</tr>";
return $html;
}
# call...
echo table_header();
loop
echo row($1var, $2var, $3var, $4var, $5var, $6var, $7var);
end loop
echo "</table>";
Is that what your looking for ?
If you want to skip a col in a row you wold just do...
PHP Code:
echo row($1var, " ", $3var, $4var, $5var, " ", $7var);
And it will add nothing to that cell... you could just use a double quote but the some browser dont like compleatly empty cells so the & n b s p ;works best (im my opion).
_
_
-
Mar 2nd, 2006, 11:02 AM
#3
Thread Starter
Frenzied Member
Re: Table stuctures
thats working to a point but it seems to be adding a row at the top every time the script is run, you see a new dot at the left top hand side on every incoming , so my rows of data are filling up but moving down each time, any idea whats causing this?
-
Mar 3rd, 2006, 05:13 AM
#4
Member
Re: Table stuctures
Any chance you can post the code your using to file the table with ?
or
Explan in alitlte more detail what you want to do, where your gettin the info form or if your filling the table form a loop.
You said you need a table with 7 headers and 5 incoming vars... is that gonna be 5 rows which will span 7 columns ?
_
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|