Académique Documents
Professionnel Documents
Culture Documents
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Table de multiplication</title>
<style>
table {
border-collapse: collapse;
margin-top: 20px;
th, td {
padding: 10px;
text-align: right;
</style>
</head>
<body>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
} else {
} else {
echo displayMultiplicationForm();
function displayMultiplicationForm() {
return <<<HTML
<div>
</form>
</div>
HTML;
$output .= "<table>";
// En-tête de colonnes
$output .= "<tr><th></th>";
$output .= "<th>$i</th>";
$output .= "</tr>";
// Corps du tableau
$output .= "<tr><th>$i</th>";
}
$output .= "</tr>";
$output .= "</table>";
return $output;
?>
</body>
</html>
Ex2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Table de multiplication</title>
<style>
table {
border-collapse: collapse;
margin-top: 20px;
th, td {
border: 1px solid black;
padding: 10px;
text-align: right;
</style>
</head>
<body>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
} else {
} else {
echo displayMultiplicationForm();
}
// Fonction pour afficher le formulaire
function displayMultiplicationForm() {
return <<<HTML
<div>
</form>
</div>
HTML;
$output .= "<table>";
// En-tête de colonnes
$output .= "<tr><th></th>";
$output .= "<th>$i</th>";
$output .= "</tr>";
// Corps du tableau
$output .= "<tr><th>$i</th>";
$output .= "</tr>";
$output .= "</table>";
return $output;
?>
</body>
</html>