Jump to content

Recommended Posts

Hi,

 

 

The number of pages are going out of table........

 

Here is the code

 

<td id="productslist_disply_number">


   <?php
// Make the links to other pages, if necessary.
if ($pages > 1) {

 echo '<p>';

 // Determine what page the script is on:
 $current_page = ($start/$display) + 1;

 // If it's not the first page, make a Previous link:
 if ($current_page != 1) {
  echo '<a href="products.php?s=' . ($start - $display) . '&p=' . $pages . '"><</a>';
 }

    // Make all the numbered pages:
    for ($i = 1; $i <= $pages; $i++) {
	 if ($i != $current_page) {
	  echo '  <a href="products.php?s=' . (($display * ($i - 1))) . '&p=' . $pages . '">' . $i . '</a>  ';
	 } else {
	  echo $i;
	 }
    } // End of FOR loop. 

    // If it's not the last page, make a Next button:
    if ($current_page != $pages) {
	 echo '<a href="products.php?s=' . ($start + $display) . '&p=' . $pages . '">></a>';
    }
    echo '</p>'; // Close the paragraph. 
 } // End of links section.
?>




   </td>

post-133288-0-44946900-1353997327_thumb.png

Link to comment
https://forums.phpfreaks.com/topic/271230-layout-problem/
Share on other sites

I tried to change the code like this

but still other problem....

 

<td id="productslist_disply_number">


   <?php

// Make the links to other pages, if necessary.
if ($pages > 1) {

 echo '<p>';

 // Determine what page the script is on:
 $current_page = ($start/$display) + 1;

 // If it's not the first page, make a Previous link:
 if ($current_page != 1) {
  echo '<div style="float:left;"><a href="products.php?s=' . ($start - $display) . '&p=' . $pages . '"><</a></div>';
 }


    // Make all the numbered pages:
    for ($i = 1; $i <= $pages; $i++) {
	 if ($i != $current_page) {
	  echo '<div style="float:left;">  <a href="products.php?s=' . (($display * ($i - 1))) . '&p=' . $pages . '">' . $i . '</a>  </div>';
	 } else {
	  echo $i;
	 }
    } // End of FOR loop.  


    // If it's not the last page, make a Next button:
    if ($current_page != $pages) {
	 echo '<div style="float:left;"><a href="products.php?s=' . ($start + $display) . '&p=' . $pages . '">></a></div>';
    }

    echo '</p>'; // Close the paragraph.  
 } // End of links section.
?>




   </td>

 

 

CSS for td is this

 

#productslist_disply_number {

text-align:center;

font-size:17px;

height:30px;

padding:10px;

border-spacing:0;

border-top:#999 1px solid;

}

post-133288-0-03144000-1353997904_thumb.png

Edited by arunpatal
Link to comment
https://forums.phpfreaks.com/topic/271230-layout-problem/#findComment-1395420
Share on other sites

In your first post: &nbsp ; is a Non-Breaking SPace. Which means "do not word-wrap here". Since there are no other spaces in your "Paragraph" there is nowhere for the browser to wrap, so the line goes on forever. To fix this, put a space between each of the entries:

 

echo '   <a href="products.php?s=' . (($display * ($i - 1))) . '&p=' .
#.....^ That's a space

Link to comment
https://forums.phpfreaks.com/topic/271230-layout-problem/#findComment-1395422
Share on other sites

In your first post: &nbsp ; is a Non-Breaking SPace. Which means "do not word-wrap here". Since there are no other spaces in your "Paragraph" there is nowhere for the browser to wrap, so the line goes on forever. To fix this, put a space between each of the entries:

 

echo '   <a href="products.php?s=' . (($display * ($i - 1))) . '&p=' .
#.....^ That's a space

 

Hi, I just solved it......

 

i just changed 1 code line which is in my 2nd post

This is the code line i changed and got it work

 

echo '<div id="productslist_disply_number_phpcode">' . $i . '</div>';

 

Thanks for looking into this topic :)

Link to comment
https://forums.phpfreaks.com/topic/271230-layout-problem/#findComment-1395426
Share on other sites

Even better: Don't use &nbps to create whitespace, but use margins and/or paddings as you should. It'll give you a lot more control to actually control the layout with CSS. As an added bonus you'll avoid issues like this as well.

 

Thank you to you also......

as i am learning so i will give a try to this also :)

Edited by arunpatal
Link to comment
https://forums.phpfreaks.com/topic/271230-layout-problem/#findComment-1395427
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.