I am trying to make a page that shows the conversion of 1 to 10 dollars, dollar for dollar and that is printed using a while loop but inside a table, but until now I have not been successful. The code that I created goes something like this:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TablaDolar</title>
</head>
<body>
<table width="200" border="1">
<tbody>
<tr>
<td>Dolares</td>
<td>Monto</td>
</tr>
</tbody>
</table>
<script>
var monto = 0;
var dolar = 17,10;
var a = "";
var vueltas = 0;
while(vueltas < 10){
a = "<table width="200" border="1">"
+ "<tbody>"
+ "<tr>"
+ "<td>" + dolar + "</td>"
+ "<td>" + monto + "</td>"
+ "</tr>"
+ "</tbody>"
+ "</table>";
document.write(a);
vueltas ++;
dolar +;
monto ++;
}
Amount indicates the amount of dollars that are being converted dollar indicates the value of the dollar in pesos