Skip to content
Snippets Groups Projects
Commit 4ba03c44 authored by user's avatar user
Browse files

4 questions left

parent f89d7672
Branches
Tags
No related merge requests found
<?php
// function.php
function tableMult($numero, $taille) {
echo "<h2>Table de multiplication de $numero (1 à $taille)</h2>";
echo "<table border='1'>";
echo "<style>
table {
border: 1px solid black;
border-collapse: collapse;
}
</style>";
echo "<table>";
for ($i = 1; $i <= $taille; $i++) {
echo "<tr>";
echo "<td>$numero</td>";
......@@ -15,3 +23,5 @@ function tableMult($numero, $taille) {
}
?>
<?php
include "function.php";
// Retrieve values from the URL parameters
$numero = isset($_GET['numero']) ? intval($_GET['numero']) : 1; // Default to 1 if not provided
$taille = isset($_GET['taille']) ? intval($_GET['taille']) : 10; // Default to 10 if not provided
echo "<div style='display: flex; flex-wrap: wrap; gap: 10px;'>"; // Flex container
echo "<div style='flex: 1 0 100%;'>"; // Flex item taking 100% width for the header
echo "<h2>Tables de multiplication paramétrées</h2>";
echo "</div>";
// Display the table based on parameters
echo "<div style='flex: 1 0 100%;'>";
tableMult($numero, $taille);
echo "</div>";
echo "</div>";
?>
<?php
include "function.php";
echo "<div style='display: flex; flex-wrap: wrap; gap: 4px;'>";
for ($i = 1; $i <= 10; $i++) {
echo "<div style='flex: 1 0 18%;'>"; // Flex item with a width of around 18% (adjust as needed)
tableMult($i, 10);
echo "</div>";
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment