Hi Leutz,
ich durchforste den ganzen Tag schon das Netz, nach Alternativen zu innerHTML für Tabellen.
Grund ist, ich will neue Zeilen einfügen, was Problemlos im FF und Opera funtzt, aber der IE nicht mitmacht
das ist die JavaScript-prozedur:
Code:
for (i=5; i<10; i++){
var new_nr= (Number(i)+1);
document.getElementById("Table_Catalogorder").innerHTML += '<tr><td style="border-bottom:1px solid #ADA08D" align="center" class="main" width="60px">'+new_nr+'</td><td style="border-bottom:1px solid #ADA08D; padding-left:10px;" align="left" class="main" width="120px"><input id="dbP_bestellnr_'+i+'" type="text" onBlur="setRequest(\'dbP\',\''+i+'\');" size="12" value=""></td><td style="border-bottom:1px solid #ADA08D; padding-right:10px" align="right" class="main" width="50px"><input id="dbP_menge_'+i+'" type="text" size="3" value=""></td><td style="border-bottom:1px solid #ADA08D; padding-left:10px" align="left" class="main" width="200px"><div id="dbP_div_info_'+i+'"> </div></td><td style="border-bottom:1px solid #ADA08D; align="right" class="main" width="15px"><a href="javascript:del_line(\''+i+'\',\'dbP\')"><img border="0" alt="delete article" src="'+papierkorb+'"></a></td></tr>';
}
Die Tabelle sieht so aus:
<table>
PHP:
echo '<table>';
for ($c_line=0; $c_line<=4; $c_line++){
echo '<tr>'."\n";
echo '<td class="orderbox" name="dbP_Position_' . $c_line . '" align="center" class="main" width="72px">' . ($c_line+1) .'</td>'."\n";
if (($list_all_produts[$c_line]>'') && ($list_all_produts[$c_line]<>'undefined')){
$value = explode("--", $list_all_produts[$c_line]);
echo '<td class="orderbox_left" align="left" class="main" width="82px"><input name="dbP_bestellnr_'.$c_line .'" id="dbP_bestellnr_'.$c_line .'" type="text" onBlur="setRequest(\'dbP\',\''. $c_line.'\');" size="12" value="'.$value[0]. '"></td>'."\n";
echo '<td class="orderbox_right" align="right" class="main" width="72px"><input name="dbP_menge_'.$c_line .'" id="dbP_menge_'.$c_line .'" type="text" size="3" value="'.$value[1]. '"></td>'."\n";
echo '<td class="orderbox_left" align="left" class="main" width="280px"><div name="dbP_div_info_'.$c_line .'" id="dbP_div_info_' .$c_line.'"> </div></td>'."\n";
}
else{
echo '<td class="orderbox_left" align="left" class="main" width="82px"><input name="dbP_bestellnr_'.$c_line .'" id="dbP_bestellnr_'.$c_line .'" type="text" size="12" value="" onBlur="setRequest(\'dbP\',\''. $c_line.'\');"></td>'."\n";
echo '<td class="orderbox_right" align="right" class="main" width="72px"><input name="dbP_menge_'.$c_line .'" id="dbP_menge_'.$c_line .'" type="text" size="3" value=""></td>'."\n";
echo '<td class="orderbox_left" align="left" class="main" width="280px"><div name="dbP_div_info_'.$c_line .'" id="dbP_div_info_' .$c_line.'"> </div></td>'."\n";
}
echo'<td style="border-bottom:1px solid #ADA08D; align="right" class="main" width="70px"><a href="javascript:del_line(\''.$c_line.'\',\'dbP\')"><img border="0" alt="delete article" src="includes/languages/german/images/buttons/small_delete.gif"></a></td>'."\n";
echo '</tr>'."\n";
}
echo '</table>';
Wäre froh wenn mir da jemand helfen könnte...