bonjour,
je voudrais faire une pagination dans un tableau, et j'a trouvé comme moyen pear.. mais je sais pas comment afficher ça dans chaque <td>!!
voila le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 
 
<link rel="stylesheet" href="../Public/style.css" type="text/css" />
 
<?php
require_once '../Pager.php';
include ('../modeles/pdo.php');
 
 
//create dummy array of data
$myData = array();
$rep = $bdd->query('SELECT * FROM domaines');
	  $i=1;
         while ( $d = $rep->fetch())
	      {  $myData[] = $d['label_domaine']; }
 
 
$params = array(
    'itemData' => $myData,
    'perPage' => 10,
    'delta' => 4,             // for 'Jumping'-style a lower number is better
    'append' => true,
    'separator' => '| ',
	'spacesBeforeSeparator' => 1, // largeur de separateur entre les nombres
    'clearIfVoid' => false,
    'urlVar' => 'entrant',
    'useSessions' => true,
    'closeSession' => true,
    'mode'  => 'Sliding',    //try switching modes
    'mode'  => 'Jumping',
	'nextImg'    => '<img src="next.png" width="30px" height="20px"  />',
    'prevImg'    => '<img src="precedent.png"  width="30px" height="20px"/>',
 
);
$pager = & Pager::factory($params);
$page_data = $pager->getPageData();
$links = $pager->getLinks();
 
$selectBox = $pager->getPerPageSelectBox();
?>
 
<html>
<head>
<title>Pagination</title>
</head>
<body>
 
<table border="1" width="500" summary="example 1"  bordercolor="#666666">
 <tr>
		<td colspan="3" align="center">
		<?php echo $links['all']; ?>
		</td>
	</tr>
 
 <th>ID</th> <th>TITRE</th>
 
 <tr>
 <td><input  type='hidden' name='id_domaine'  value="<?php $d['id_domaine'] ?> " /> <?php echo $i;?></td>
  <?php  $i++; ?>
   		<td colspan="3">
			<pre><?php print_r($page_data); ?></pre>
		</td>
	</tr>
</table>
 
 
<hr />
 
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
Select how many items per page should be shown:<br />
<?php echo $selectBox; ?> &nbsp;
<input type="submit" value="submit" />
</form>
 
<hr />
 
</body>
</html>

Merci de me repondre