1
I have a select that brings items with prices, as I do to divide the result into two columns: Examples:
Follow my code:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TABELA OFERTAS</title>
<link rel="stylesheet" href="dist/css/bootstrap.min.css">
<script src="dist/js/jquery.min.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
<style type="text/css">
body {
background-image: url("img/fundo.jpg");
width: 100%;
height: auto;
}
</style>
</head>
<body nload="toggleFullScreen()">
<div class="container">
<br>
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-4">
<img src="img/logo.png" style="width: 150px;">
</div>
<div class="col-md-8">
<h3>OFERTAS</h3>
</div>
</div>
</div>
</div>
<br>
<?php
include 'data/conexao.php';
$listaProdutos = "SELECT * FROM prod_imp";
$result = mysqli_query($conn, $listaProdutos);
while($row = mysqli_fetch_assoc($result)) { ?>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-body">
<?php echo "<h3>". $row["prod_imp_nome"] ."</h3>"; ?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-body">
<?php echo "<h3> R$" . str_replace('.', ',', $row["prod_imp_preco"] ). "KG </h3>"; ?>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</body>
</html>
The idea would be, every 10 products create a new column.
@No, it’ll always be two columns
– Chefe Druida
@Sam knows how to implement this in the code ?
– Chefe Druida
Perhaps it would be better to divide by 2 columns when it is above 1, no?
– Sam
@sam can be too
– Chefe Druida
@That’s right, thank you, post your reply to be able to dial please
– Chefe Druida