"> 02-03_for "> 02-03_for ">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>02-03_for</title>
<style type="text/css">
table {
	border: 1px solid gray;
	border-collapse: collapse;
}
td {
	text-align: center;
	padding: 5px;
}

</style>
<script type="text/javascript">
	let last = prompt('마지막 숫자 입력')
	let sum = 0;
	
	for(let i=1; i<=last; i++){
		sum +=i;
	}
	document.write('<b>1 ~ ' + last + ' 까지의 합 : ' + sum + '</b>');
	document.write('<br/><br/>');
	
	let gugudan = '<table>';
	for(let dan=1; dan<=9; dan++){
		gugudan += '<tr>';
		for(let su=1; su<=9; su++){
			gugudan += '<td>' + su + ' X ' + dan + ' = ' + (dan*su) + '</td>';
		}
		gugudan += '</tr>';
	}
	gugudan += '</table>';
	document.write(gugudan);
	document.write('<br/><br/>');
</script>
</head>
<body>

</body>
</html>