php html table 个单元格的宽度和高度
width and height of an html table cells in php
//抱歉代码不好,法语我是新手,我只想让用户选择单元格的宽度和高度,请尽可能简单。
<form method="POST">
Nombre de Lignes: <input type="text" name="lign">
Taille de Bordure: <input type="text" name="border">
Nombre de Colonnes: <input type="text" name="ncol">
Largeur de Colonnes: <input type="text" nom="widh">
Longueur de Colonnes: <input type="text" nom="heig">
<input type="submit">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$l = $_POST["lign"];
$b = $_POST["border"];
$c = $_POST["ncol"];
$widh = $_POST["widh"];
$heig = $_POST["heig"];
echo "<table border=$b cellspacing=\"0\">";
for ($i = 1; $i <=$l; $i++){
echo "<tr>";
for ($j = 1;$j <= $c; $j++){
echo ("<td width='$widh' height='$heig'> </td>");
}
echo "</tr>";
}
echo "</table>";
?>
正确更新输入属性,'name':
Largeur de Colonnes: <input type="text" name="widh">
Longueur de Colonnes: <input type="text" name="heig">
PHP 代码应该是这样的:
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$l = $_POST["lign"];
$b = $_POST["border"];
$c = $_POST["ncol"];
$widh = $_POST["widh"];
$heig = $_POST["heig"];
echo "<table border='$b' cellspacing='0'>";
for ($i = 1; $i <= $l; $i++) {
echo "<tr>";
for ($j = 1; $j <= $c; $j++) {
echo "<td width='$widh' height='$heig'> </td>";
}
echo "</tr>";
}
echo "</table>";
}
//抱歉代码不好,法语我是新手,我只想让用户选择单元格的宽度和高度,请尽可能简单。
<form method="POST">
Nombre de Lignes: <input type="text" name="lign">
Taille de Bordure: <input type="text" name="border">
Nombre de Colonnes: <input type="text" name="ncol">
Largeur de Colonnes: <input type="text" nom="widh">
Longueur de Colonnes: <input type="text" nom="heig">
<input type="submit">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$l = $_POST["lign"];
$b = $_POST["border"];
$c = $_POST["ncol"];
$widh = $_POST["widh"];
$heig = $_POST["heig"];
echo "<table border=$b cellspacing=\"0\">";
for ($i = 1; $i <=$l; $i++){
echo "<tr>";
for ($j = 1;$j <= $c; $j++){
echo ("<td width='$widh' height='$heig'> </td>");
}
echo "</tr>";
}
echo "</table>";
?>
正确更新输入属性,'name':
Largeur de Colonnes: <input type="text" name="widh">
Longueur de Colonnes: <input type="text" name="heig">
PHP 代码应该是这样的:
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$l = $_POST["lign"];
$b = $_POST["border"];
$c = $_POST["ncol"];
$widh = $_POST["widh"];
$heig = $_POST["heig"];
echo "<table border='$b' cellspacing='0'>";
for ($i = 1; $i <= $l; $i++) {
echo "<tr>";
for ($j = 1; $j <= $c; $j++) {
echo "<td width='$widh' height='$heig'> </td>";
}
echo "</tr>";
}
echo "</table>";
}