M
Mahmoud
When I wrote the following code to create a dynamic table with styles
associated with each row, it worked in Firefox. But when this was tried
in IE, the result was a table with no styles that were displayed. Could
someone explain to me how a dynamic table should be created (in IE)?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="css/1.css" type="text/css" />
</head>
<body>
<table id="gst">
<tr>
<td>Rent</td>
<td>BR</td>
<td>Name</td>
<td>Street</td>
<td>Date</td>
</tr>
<tr class="odd" onmouseover = 'this.className="over"'
onmouseout='this.className="odd"' onclick='openWindow(1,lease_list)'>
<td>RR</td>
<td>RR</td>
<td>RR</td>
<td>RR</td>
<td>RR</td>
</tr>
</table>
<script type="text/javascript">
function showTable(){
table = document.getElementById('gst');
var x=table.insertRow(1);
var y=x.insertCell(0);
var z=x.insertCell(1);
x.setAttribute('onclick','openWindow('+' '+'1,lease_list)');
cl="odd";
x.setAttribute('class',cl);
x.setAttribute('onmouseover','this.className="over"');
x.setAttribute('onmouseout','this.className="'+cl+'"');
y.innerHTML="NEW CELL1";
z.innerHTML="NEW CELL2";
}
showTable();
</script>
</body>
</html>
associated with each row, it worked in Firefox. But when this was tried
in IE, the result was a table with no styles that were displayed. Could
someone explain to me how a dynamic table should be created (in IE)?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="css/1.css" type="text/css" />
</head>
<body>
<table id="gst">
<tr>
<td>Rent</td>
<td>BR</td>
<td>Name</td>
<td>Street</td>
<td>Date</td>
</tr>
<tr class="odd" onmouseover = 'this.className="over"'
onmouseout='this.className="odd"' onclick='openWindow(1,lease_list)'>
<td>RR</td>
<td>RR</td>
<td>RR</td>
<td>RR</td>
<td>RR</td>
</tr>
</table>
<script type="text/javascript">
function showTable(){
table = document.getElementById('gst');
var x=table.insertRow(1);
var y=x.insertCell(0);
var z=x.insertCell(1);
x.setAttribute('onclick','openWindow('+' '+'1,lease_list)');
cl="odd";
x.setAttribute('class',cl);
x.setAttribute('onmouseover','this.className="over"');
x.setAttribute('onmouseout','this.className="'+cl+'"');
y.innerHTML="NEW CELL1";
z.innerHTML="NEW CELL2";
}
showTable();
</script>
</body>
</html>