안녕하세요 행 및 열 생성에 대한 질문이 있습니다. 한 페이지에만 어떻게 만들 수 있는지 묻고 싶습니다. 이것이 제가 시도한 것입니다.테이블 생성기
HTML :
<html>
<head>
<title>Table Generator</title>
<body>
<center><h1>Generate Your Table</h1></center>
<div id="div1">
<center><h4>Enter number of Row and Column</h4>
<form action="get_table/execute_table.php" method="POST">
<label for="title">Row</label>
<input type="text" name="title1" placeholder="Row">
<br>
<label for="title">Column</label>
<input type="text" name="title2" placeholder="Column">
<br>
<input type="submit" name="submit" value="Generate Table"> </center>
</form>
</div>
</body>
이
PHP : 네, 완전히 실행하지만 난 거기에 단 1 페이지를 원하는
<?php
$row = $_POST['title1'];
$column = $_POST['title2'];
echo "<table border='1'>";
for($tr=1;$tr<=$row;$tr++){
echo "<tr>";
for($td=1;$td<=$column;$td++){
echo "<td>row: ".$tr." column: ".$td."</td>";
}
echo "</tr>";
}
echo "</table>";
?>
. 감사.
@Ghost라는 아이디어에 감사드립니다. :) –
@DontStopLearning 확실하게 도움이 됨 – Ghost