Page 1 of 1

Need help with page wrap please

Posted: Mon Mar 03, 2008 11:57 am
by Gino01
Hi, I've inherited a website with some PHP code in it that I am not familiar with at all. I have a following problem: Each page generated has a header where user can navigate to any previous order pages (now over 100 currently). Over time as number of orders grew the page kept expending to the right, making users scroll for quite some time in order to get to their buttons on the right. The code below is what generates that header. Is there a way to get the header to wrap around the page?

print "<td colspan=4 align=right>Pages:".pageSearchNumber ($num_rows,$n_show,$startFrom);

Thanks!

Re: Need help with page wrap please

Posted: Mon Mar 03, 2008 12:07 pm
by Zoxive
This is a display issue(Client side/ html & css), not php related. Other then what the function `pageSearchNumber` outputs.

Possible solution:
You could set a fixed width of your table, or row so it does not expand. But if the output does not contain spaces, it will still expand.

Re: Need help with page wrap please

Posted: Mon Mar 03, 2008 12:18 pm
by Gino01
As soon as I change <table width=100% border=0 cellpadding=10 cellspacing=0 align=center>

to table width = "860" it gives me an error below

Parse error: syntax error, unexpected T_LNUMBER in /home/gino01/public_html/reservation/admin/view_pending_reservation1.php on line 17

Re: Need help with page wrap please

Posted: Mon Mar 03, 2008 12:27 pm
by Zoxive
Normally we would need to code with your php errors, but this is a simple one.

Your string most likely looks something like..

Code: Select all

$Table ="<table width=100% border=0 cellpadding=10 cellspacing=0 align=center>";
Then you change it to

Code: Select all

$Table ="<table width="860" border=0 cellpadding=10 cellspacing=0 align=center>";
Notice any problems? ^^

Code: Select all

// Correct
$Table ="<table width=\"860\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" align=\"center\">";
// OR
$Table ='<table width="860" border="0" cellpadding="10" cellspacing="0" align="center">';

Re: Need help with page wrap please

Posted: Mon Mar 03, 2008 1:45 pm
by Gino01
That was the problem with the table width, but it still hasn't solved the wrap problem

the output looks like this: Pages: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 2.....

looks like there spaces between each page number.
I am playing around with HTML side of it to see if I can make it wrap