Re: html table dynamic dimensions that track a for loop
- From: Dr John Stockton <jrs@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 18 Nov 2005 14:02:15 +0000
JRS: In article <1132222503.593938.87260@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
dated Thu, 17 Nov 2005 02:15:03, seen in news:comp.lang.javascript,
murrayatuptowngallery <murrayatuptowngallery@xxxxxxxxx> posted :
>
><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>
Consider :
<script type="text/javascript">
function AAA(K) { return 2*0.1*Math.round(10*Math.log(K)/Math.log(2)) }
var AA = [[32, 16], [8, 5.656, 1.414]]
T = '<table border="5"><tr><td>';
for (J=0 ; J<AA.length; J++) { AAJ = AA[J]
T += "<tr>"
for (K=0 ; K<AAJ.length ; K++)
T += "<td>" + "AAA(" + AAJ[K] + ") = " + AAA(AAJ[K]) + "<\/td>"
T += "<\/tr>" }
T += '<\/table>';
document.write(T);
</script>
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
.
- Follow-Ups:
- Re: html table dynamic dimensions that track a for loop
- From: murrayatuptowngallery
- Re: html table dynamic dimensions that track a for loop
- References:
- html table dynamic dimensions that track a for loop
- From: murrayatuptowngallery
- html table dynamic dimensions that track a for loop
- Prev by Date: Re: html table dynamic dimensions that track a for loop
- Next by Date: Re: 'this' and setInterval
- Previous by thread: Re: html table dynamic dimensions that track a for loop
- Next by thread: Re: html table dynamic dimensions that track a for loop
- Index(es):
Relevant Pages
|
Loading