$result1= mysql_query("SELECT IDNumber AS r1IDNumber, FROM wanuserinformation",$db) or die("Query failed : " . mysql_error()
if ($myrow1 = mysql_fetch_array($result1))
{
?>
<table border=2 bordercolor=red>
<tr><td>ID Number</td>
<?php
$count=1;
do
{
$count=$count+1;
?>
<td id="pc"><input type="text" name="pcnotes<?php echo $count; ?>"></td>
<?php
echo "</tr></table>";
}while ($myrow1 = mysql_fetch_array($result1));
I know how to use javascript and css to change a static table. But how would you go about changing a table created using code. Since the id's will change row to row.
build a pattern out of the id's.. like pcnotes_1_1 for the upper left (first row, first column) cell.. and so on..then just run ~blindly through the id's until you hit an undefined id.
To make that table have one cell shrink, but when I add a second cell I would then have to have a second function for it. So not sure how to go about, running through the code to get that. I am aware roughly that you can assign a class and run through and grab id's but not sure how.
function getElem( id )
{
return document.getElementById ? document.getElementById( id ) : document.allї id ];
}
function hideColumn( column )
{
var obj;
var c = 0;
var col = parseInt(column);
while(obj = getElem( 'pcnotes_' + (++c) + '_' + col)) obj.style.display = 'none';
}
hideColumn( 2 );
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
did you even notice the id names mine uses?