Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Problem With Firefox Text Alignment

Recommended Posts

I just have a really simple annoyin prob with my site which I have only just noticed. If i view the site in IE the alignment is fine but when in Firefox it isnt properly aligned.
The user searches the db and it returns a table with the results..


PHP Code:

echo '<br><table width="871" border="0" align="center" cellpadding="0" cellspacing="0"><tr><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong>'; echo 'Artists beginning with '.$alphaletter. '<th><table border="1"  width="250" align="left"><br><tr align="left"><th>Artist</th></font></strong></tr>';
IE reads this as the echo "Artists.. " bit within the table but Firefox puts the "Artists.." part outside and so then its tight against the left side instead of indented. I have tried CSS but it doesnt seem to b working..all my other css works fine just not this. Can anyone suggest a way round it?

Thanks,kvarnerexpress

Share this post


Link to post
Share on other sites

Um, you may wanna try fixing up your HTML coding. It's all totally whack. I dont know how Internet Explorer was able to figure out what you want, but i had trouble. I removed the Table Header tag, and placed in some Table Data tags. I've also moved some other tags where they belonged.

Try This:

echo '<br><table border="0" width="871" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong>Artists beginning with'  .$alphaletter. '</strong></font><table border="1" width="250" align="left"><tr><td align="left">Artist</td></tr></table></td></tr></table>';

Share this post


Link to post
Share on other sites

I agree with truefusion...it is really hard to see what you are trying to do. Try truefusion's code, it should work for you.

 

I would also suggest that you consider ditching tables. They are really messy, especially with new CSS that is more powerful than tables. I would also suggest that you use "semantic" markup--use only tags for structure, and then only when that is the best tag to use--then almost all browsers will read your HTML and CSS correctly (or however you intend it to be read).

 

Good Luck and good coding!! :)

Share this post


Link to post
Share on other sites

U can use this<?phpPrint (" your html code just change " to ' like : <a haref='yahoo.com'>yahoo<a>");?>With fire fox and ie and any browser you can view at local and then upload your filei think IE vs Firefox in TabelsIts really hard to show one page correctly in IE and firefoxi think this discrepancy in IE and firefox in Time to Read Html tags :)

Share this post


Link to post
Share on other sites

C'm on guys.. we are NOT living in the 90'ies anymore...

 

a <table> icw align=center is NOT ALLOWED

 

besides, he was talking about TEXT alignment.. so, how about:

 

CSS

td.mystyle

{

text-align: center;

width: 871;

padding: 0;

}

 

HTML

 

<td class="mystyle">

yadda yadda

</td>

Share this post


Link to post
Share on other sites

The font tag is not exactly valid HTML any more. use something better like span

e.g

<span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">   </span>
Much better!

Share this post


Link to post
Share on other sites

The font tag is not exactly valid HTML any more. use something better like span

It depends on the situation. <span> is an inline tag and should only be used inside block level elements to achieve different styles within a larger style. For instance, if you have a sentence in black but you want some words blue, you'd do this:

<p style="color: black;">Your sentence goes here with <span style="color: blue;">these words in blue</span>.</p>
Spans shouldn't be used to contain blocks of content by themselves, ie whole paragraphs - that's what <p> is for.

Share this post


Link to post
Share on other sites

use

echo '<br><table width="871" border="0" align="center" cellpadding="0" cellspacing="0"><tr><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong>'; echo 'Artists beginning with '.$alphaletter.'<th><table border="1"  width="250" align="left"><br><tr align="left"><th>Artist</th></font></strong></tr>';
instead of this
echo '<br><table width="871" border="0" align="center" cellpadding="0" cellspacing="0"><tr><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong>'; echo 'Artists beginning with '.$alphaletter. '<th><table border="1"  width="250" align="left"><br><tr align="left"><th>Artist</th></font></strong></tr>';
maby thatll work, white space can be bothersome

Notice from cmatcmextra:
Fixed code tags

Edited by cmatcmextra (see edit history)

Share this post


Link to post
Share on other sites

use

echo '<br><table width="871" border="0" align="center" cellpadding="0" cellspacing="0"><tr><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong>'; echo 'Artists beginning with '.$alphaletter.'<th><table border="1"  width="250" align="left"><br><tr align="left"><th>Artist</th></font></strong></tr>';[/cpde]instead of this[code]echo '<br><table width="871" border="0" align="center" cellpadding="0" cellspacing="0"><tr><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong>'; echo 'Artists beginning with '.$alphaletter. '<th><table border="1"  width="250" align="left"><br><tr align="left"><th>Artist</th></font></strong></tr>';
maby thatll work, white space can be bothersome
You've just copied exactly the same thing and haven't changed anything. ^_^

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.