Paul is on the right track -- and word of advice, you'll find your code a lot less of a train wreck if you use ECHO instead of constantly dropping in and out of parse mode for no good reason with <?php ?> -- but there's a reason I consider using php as a 'on/off scripter' to be a crutch for people coming from crappy languages instead of using it like a real programming language.
It also helps not to drag execution to a crawl by doing the double quote escape double quote nonsense. Single quotes are faster, and you don't have to turn the code into a confusing MESS by escaping everything.
Some carriage returns and tabs wouldn't hurt either... and TITLE doesn't belong on IMG, ALT does. You want to use TITLE put it on the ANCHOR.
It also wouldn't hurt to get rid of the things that have no business in modern markup like the border attribute, non-breaking spaces to do padding and white-space:nowrap's job, and as paul pointed out lose the span being used to do what can be directly done to the anchor.
... and as Paul mentioned, legend is a pain in the ass to style, which is why I usually put a dummy span inside the legend and APO it off the fieldset or div wrapping the fieldset (since fieldsets also are completely unpredictable cross-browser).
<legend><span>',(!$Prev_Page ? '' : '
</a>'),($Num_Rows== 0 ? '' : '
Displaying'.$Page.' of '.$Num_Rows.' Meters'
),($Page==$Num_Pages ? '' : '
It sucks to put the extra div around the fieldset and the span inside the legend, but you cannot trust either element for to accept styling the same way cross browser but you need them for semantics -- so you have to use semantically neutral wrappers to fix that.
... and don't give me that horse hockey you hear from php developers on how it's too hard to make clean code output or use single quotes instead of doubles, because, well... there it is