Good I'm doing some tables that print parimpar numbers and 5 in 5 but I already did them in for and while but when I try to do it in do while I throw another result I do not know what is due
this is with the for:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Este ejercicio es del for</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Basic Table</h2>
<p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p>
<table class="table">
<thead>
<th>1 a 11</th>
<th>11 a 1</th>
<th> par </th>
<th> impar </th>
<th> 5 en 5 </th>
</thead>
<tbody>
<?php
for($i=1; $i<12; $i++)
{
echo "<tr>";
echo "<td>".($i). "</td>";
echo "<td>".(11-$i)."</td>";
echo "<td>".($i * 2 )."</td>";
echo "<td>".($i * 2 -1)."</td>";
echo "<td>".($i * 5 - 5)."</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</body>
</html>
THIS IS WITH THE WHILE:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Este ejercicio es del while</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Basic Table</h2>
<p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p>
<table class="table">
<thead>
<th>1 a 11</th>
<th>11 a 1</th>
<th> par </th>
<th> impar </th>
<th> 5 en 5 </th>
</thead>
<tbody>
<?php
$i=1;
while($i<12)
{
echo "<tr>";
echo "<td>" .$i."</td>";
echo "<td>".(11-$i)."</td>";
echo "<td>".($i * 2 )."</td>";
echo "<td>".($i * 2 -1)."</td>";
echo "<td>".($i * 5 - 5)."</td>";
echo "</tr>";
$i++;
}
?>
</tbody>
</table>
</div>
</body>
</html>
AND THIS WITH THE DO WHILE DOES NOT WORSE THE RESULT
<!DOCTYPE html>
<html lang="en">
<head>
<title>Este ejercicio es del for</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Basic Table</h2>
<p>The .table class adds basic styling (light padding and only horizontal dividers) to a table:</p>
<table class="table">
<thead>
<th>1 a 11</th>
<th>11 a 1</th>
<th> par </th>
<th> impar </th>
<th> 5 en 5 </th>
</thead>
<tbody>
<?php
$i=1;
do{
echo "<tr>";
echo "<td>".($i). "</td>";
echo "<td>".(11-$i)."</td>";
echo "<td>".($i * 2 )."</td>";
echo "<td>".($i * 2 -1)."</td>";
echo "<td>".($i * 5 - 5)."</td>";
echo "</tr>";
} while($i<12);
?>
</tbody>
</table>
</div>
</body>
</html>
I DO NOT KNOW WHICH THE OTHER RESULT IS HIRING