Salve, c'è qualcuno sa dirmi come posso mettere un griglia ovvero una tabella di 4 colonne e 10 righe,
in questo codice:
la parte dove si dovrebbe mettere un semplice tag <table> e qui:
mi dite come posso fare?
grazie mille e buon fine settimana.
in questo codice:
PHP:
<?php
//Set the extensions you want to load, seperate by a comma.
$extensions = "jpeg,jpg";
//Set the number of images you want to display per page
$imagesPerPage = 6;
$page = $_GET['page'] = isset($_GET['page']) ? max( 1, intval($_GET['page']) ) : 1;
$image_thumb = glob("public/images/".$url."/thumb/*.{".$extensions."}", GLOB_BRACE);
$images = glob("public/images/".$url."/*.{".$extensions."}", GLOB_BRACE);
//Count the number of images
$totalImages = count( $image_thumb);
//Get the total pages
$totalPages = ceil($totalImages / $imagesPerPage);
//Make sure the page you are on is not greater then the total pages available.
if($page > $totalPages){
//Set the currnet page to the total pages.
$page = $totalPages;
}
//Now find where to start the loading from
$from = ($page * $imagesPerPage) - $imagesPerPage;
//Now start looping
for($i = $from; $i < ($from + $imagesPerPage); $i++){
//We need to make sure that its within the range of totalImages.
if($i < $totalImages){
//Now we can display the image!
?>
<a href="<?php echo $images[$i]; ?>" class="gallery"><img src="<?php echo $image_thumb[$i]; ?>"></a>
<?php
}
}
//Now to display the page numbers!
for($p = 1; $p <= $totalPages; $p++){
if($p == $page){
$tmp_pages[] = "<strong>{$p}</strong>";
}else{
$tmp_pages[] = "<a href='?dir={$url}&page={$p}'>{$p}</a>";
}
}
//Now display pages, seperated by a hyphon.
echo "<br />" . implode(" - ", $tmp_pages);
la parte dove si dovrebbe mettere un semplice tag <table> e qui:
PHP:
<?php //Now start looping
for($i = $from; $i < ($from + $imagesPerPage); $i++){
//We need to make sure that its within the range of totalImages.
if($i < $totalImages){
//Now we can display the image!
?>
<a href="<?php echo $images[$i]; ?>" class="gallery"><img src="<?php echo $image_thumb[$i]; ?>"></a>
<?php
}
}
mi dite come posso fare?
grazie mille e buon fine settimana.