Page 1 of 1

td align="right" and Mozilla

Posted: Wed Sep 17, 2003 9:26 pm
by nigma
Hey,

Anyone know how to get it so that <td align="right">RIGHT TEXT</td> will work when viewed in mozilla?

thanks

Posted: Wed Sep 17, 2003 9:31 pm
by scorphus
Try this and see what you get:

Code: Select all

<table border="1">
<tr>
	<td align="right">RIGHT TEXT</td>
</tr>
<tr>
	<td align="right">RIGHT TEXT (LONGER TEXT)</td>
</tr>
</table>
Regards,
Scorphus.

Posted: Wed Sep 17, 2003 9:35 pm
by nigma
I currently have:

Code: Select all

<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>LEFT TEXT</td>
<td align="right">RIGHT TEXT</td>
</tr>
</table>
Doesn't seem much diff except that new table row.

Posted: Wed Sep 17, 2003 9:37 pm
by nigma
Hmm... I had made tables display inline in my stylesheet. Changed that and it worked.

Anyone know why making a tables display inline would make
<td>'s with the align property not work in mozilla?

Posted: Wed Sep 17, 2003 10:22 pm
by scorphus
nigma wrote:...Doesn't seem much diff except that new table row.
Just a longer td content, so you can see the right alignment effect.

This piece of code worked in Mozilla:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>Test</title>
	<style>
	table &#123;
		display : inline;
	&#125;
	</style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
    <td>Test, just a test</td>
    <td align="right">Testa gain</td>
</tr>
<tr>
    <td align="right">Test and test</td>
    <td>It's all about test</td>
</tr>
</table>
</body>
</html>
Regards,
Scorphus.

Posted: Wed Sep 17, 2003 10:32 pm
by nigma
Maybe it's because I was using Strict.dtd instead of transitional? Also I was using the table inside a few divs, so that could have effected things?

Posted: Wed Sep 17, 2003 10:34 pm
by McGruff
Mixing up tables and CSS for layout can cause problems - as you've discovered.

Posted: Wed Sep 17, 2003 10:37 pm
by Unipus
It shouldn't... they are in no way incompatible.

That said, however, I have run into issues in the past getting text-align: right; to work in Mozilla. I don't think I ever figured out why.

Posted: Wed Sep 17, 2003 10:37 pm
by scorphus
I don't think it has something to do with doctype.

But "...inside divs", maybe. Post your code. Let us take a look to it.

Regards,
Scorphus.

Posted: Wed Sep 17, 2003 10:47 pm
by phice
Set width's for each td.

Posted: Wed Sep 17, 2003 11:44 pm
by nigma

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>nigma @ nigmaNET</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>

<div id="container">
<h1 class="pageheader"><span>NigmaNET</span></h1>
  <div id="navigation"><a href="#">BLOG</a><a href="#">Contact</a></div>
  <div id="mainContent"> <br />
    <p>Here is a test paragraph.<p>
  </div>
  <div id="footer">
  <table width="100%" border="0" cellpadding="0" cellspacing="1"><tr><td>
    &copy; 2003 Nigma. All Rights Reserved.</td><td align="right">
    <span style="text-align: right; margin-left: 5px">Design by <a href="http://www.urbanchaos.net">www.urbanchaos.net</a></td></tr></table>
  </div>
</div>
</div>

</body>
</html>
CSS Part for table

Code: Select all

#footer table &#123; display: inline &#125;

Posted: Thu Sep 18, 2003 12:05 am
by scorphus
I'm getting things right-aligned here, using Mozilla Firebird 0.6
I've added one row to the end of the table:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>nigma @ nigmaNET</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style2.css" />
</head>

<body>

<div id="container">
<h1 class="pageheader"><span>NigmaNET</span></h1>
  <div id="navigation"><a href="#">BLOG</a><a href="#">Contact</a></div>
  <div id="mainContent"> <br />
    <p>Here is a test paragraph.<p>
  </div>
  <div id="footer">
  <table width="100%" border="1" cellpadding="0" cellspacing="1"><tr><td>
    &copy; 2003 Nigma. All Rights Reserved.</td><td align="right">
    <span style="text-align: right; margin-left: 5px">Design by <a href="http://www.urbanchaos.net">www.urbanchaos.net</a></td></tr><tr><td>
    ...All Rights Reserved.</td><td align="right">
    <span style="text-align: right; margin-left: 5px">Design by...</td></tr></table>
  </div>
</div>
</div>

</body>
</html>
The text is right-aligned but it expands to the entire <td> so you don't see the alignment.

No changes were made to the CSS...

Hope that helps.

Cheers,
Scorphus.

Posted: Thu Sep 18, 2003 12:15 am
by nigma
Sure does man, I apreciate it. Jesse I love these damned forums!