M
murrayatuptowngallery
After a few searches & inquiries here, I have a method of generating an
html table populated with results of equations that works and wasn't
too far up a learning curve for me, thanks to a helpful
respondent/poster here...
<script type="text/javascript">
var AAA = new Array(4)
AAA[0] = 2*0.1*Math.round(10*Math.log(32)/Math.log(2))
AAA[1] = 2*0.1*Math.round(10*Math.log(16)/Math.log(2))
AAA[2] = 2*0.1*Math.round(10*Math.log(8)/Math.log(2))
AAA[3] = 2*0.1*Math.round(10*Math.log(5.656)/Math.log(2))
theTable='<table border="5"><tr><td>';
theTable+=AAA[0];
theTable+='</td><td>';
theTable+=AAA[1];
theTable+='</td></tr><tr><td>';
theTable+=AAA[2];
theTable+='</td><td>';
theTable+=AAA[3];
theTable+='</td></tr></table>';
document.write(theTable);
</script>
This is a fixed length example. In use, one selects a variable that
determines how many results are generated, using a for-loop, choosing
the range and a couple choices of increment (1, 1/2, 1/3).
Are there any implicit reasons why the array above could not be made
dynamic to track the for loop variable?
I did some searching first as is always recommended, but that seems to
be a never-ending chase for the right words to use in a question...I
DID look, but am apparently searching for the wrong keywords.
Thanks
Murray
html table populated with results of equations that works and wasn't
too far up a learning curve for me, thanks to a helpful
respondent/poster here...
<script type="text/javascript">
var AAA = new Array(4)
AAA[0] = 2*0.1*Math.round(10*Math.log(32)/Math.log(2))
AAA[1] = 2*0.1*Math.round(10*Math.log(16)/Math.log(2))
AAA[2] = 2*0.1*Math.round(10*Math.log(8)/Math.log(2))
AAA[3] = 2*0.1*Math.round(10*Math.log(5.656)/Math.log(2))
theTable='<table border="5"><tr><td>';
theTable+=AAA[0];
theTable+='</td><td>';
theTable+=AAA[1];
theTable+='</td></tr><tr><td>';
theTable+=AAA[2];
theTable+='</td><td>';
theTable+=AAA[3];
theTable+='</td></tr></table>';
document.write(theTable);
</script>
This is a fixed length example. In use, one selects a variable that
determines how many results are generated, using a for-loop, choosing
the range and a couple choices of increment (1, 1/2, 1/3).
Are there any implicit reasons why the array above could not be made
dynamic to track the for loop variable?
I did some searching first as is always recommended, but that seems to
be a never-ending chase for the right words to use in a question...I
DID look, but am apparently searching for the wrong keywords.
Thanks
Murray