Jump to content

[SOLVED] Links appearing vertically in IE


e1seix

Recommended Posts

Bit confused why this is happening...

 

echo "<table class='pag_table'>";
echo "<tr><td>";
$limitrow = $_GET['startrow'];

$max = intval($numrows/$limit);

if ($numrows%$limit) {
// has remainder so add one page
$max++;
}

if ($startrow>=2) {

echo '<a href="'.$_SERVER['PHP_SELF'].'?Cat='.$_GET['Cat'].'&startrow='.($startrow-$limit).'"><img src="/PREV.gif" /></a>';

}

if ($limitrow<(($max*$limit)-$limit)) {
// not last page so give NEXT link

echo '<a href="'.$_SERVER['PHP_SELF'].'?Cat='.$_GET['Cat'].'&startrow='.($startrow+$limit).'"><img src="/NEXT.gif" /></a><br /><br />';
}
echo "</td></tr>";

echo "<tr><td>";
print '<div id="pagmenu">';

$startrow = $_GET['startrow'];
$mid = ($startrow/$limit);
$result = ($mid+1);

echo "Page ".$result." of ".$max."<br /><br />";

print "</div>";
echo "</td></tr>";

echo "<tr><td>";
print '<span class="nummenu2">';

$max = intval($numrows/$limit);

if ($numrows%$limit) {
// has remainder so add one page
$max++;
}

for ($i=1;$i<=$max;$i++) {
echo '| <a href="'.$_SERVER['PHP_SELF'].'?Cat='.$_GET['Cat'].'&startrow='.($limit*($i-1)).'">'.$i.'</a> |';
}

print "</span>";
echo "</td></tr>";
echo "</table>";

 

It seems to stack every digit vertically ie.

 

|

1

||

2

||

3

|

 

instead of | 1 | 2 | 3 |

 

why is this? it works fine in Firefox, but not in IE. what could be causing it?

 

EDITED BY WILDTEEN88: Please use code tags (


) including code with posts. Thank you.

Link to comment
https://forums.phpfreaks.com/topic/68874-solved-links-appearing-vertically-in-ie/
Share on other sites

the <td> width doesn't appear to make a difference. i'm confused cos i can't tell if the fault is in the php or the css

 

.nummenu2 {
color: #000000;
font: normal 12px tahoma, verdana, arial, sans-serif;
text-align: center;
text-decoration: none;
width:500px;
}

.nummenu2 a{
color: #000000;
font: normal 12px tahoma, verdana, arial, sans-serif;
text-align: center;
text-decoration: none;
width:500px;
}

.nummenu2 a:hover{
color: #000000;
font: normal 12px tahoma, verdana, arial, sans-serif;
text-align: center;
text-decoration: underline;
width:500px;
}

 

any help at all appreciated.

 

the source output:

 

<td><span class="nummenu2">| <a href="/byBrand.php?ID=4507&startrow=0">1</a> || <a href="/byBrand.php?ID=4507&startrow=20">2</a> |</span></td>

perhaps becasue you're setting the width of EACH link to the width of the table cell.

 

try this for your CSS:

.nummenu2 {
text-align: center;
width:500px;
}
.nummenu2 a{
color: #000000;
font: normal 12px tahoma, verdana, arial, sans-serif;
text-decoration: none;
}
.nummenu2 a:hover{
text-decoration: underline;
}

 

don't know if that will solve the problem, but either way, its cleaner code

 

(note that you don't have to repeat css styles for child elements) 

 

i'm confused cos i can't tell if the fault is in the php or the css

 

If it is a display issue then it is NOT the PHP. Unless you specifically code your PHP to react differently based upon the client used, the output is the same no matter what browser the client is using. IT will be either the HTML or CSS implementation.

It is the width parameter in your styles that is causing the problem. Also, I would suggest changing how your are applying the styles" for example you should apply the width to the TD not the SPAN. Any you don't need to redefine a style for a sub-element if it will be the same as the parent/containing element:

 

I would suggest ditching the span tags and use the TD as the parent element:

 

.nummenu2 {
  color: #000000;
  font: normal 12px tahoma, verdana, arial, sans-serif;
  text-align: center;
  text-decoration: none;
  width:500px;
}

.nummenu2 a{
  color: #000000;
  text-decoration: none;
}

.nummenu2 a:hover{
  text-decoration: underline;
}

 

<td class="nummenu2">| <a href="/byBrand.php?ID=4507&startrow=0">1</a> || <a href="/byBrand.php?ID=4507&startrow=20">2</a> |</td>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.