View Full Version : Text Align Right trouble in FireFox?
chikna
02-06-2008, 04:55 PM
In IE works fine. Firefox gives me HeadAche? How do I fix it? Thanks.
1st option
<table>
<colgroup
<col style="width:20%; text-align:right"> ???
<col width=40%>
</colgroup>
<thead>
<tr>
<td>First Name</td>
<td>Last Name</td>
</tr>
</thead>
<tbody>
<tr>
<td>George</td>
<td>Borat</td>
</tr>
</tbody>
</table>
2nd version without COLGROUP:
<table>
<thead>
<tr>
<td>First Name</td>
<td>Last Name</td>
</tr>
</thead>
<tbody>
<tr>
<td align="right">George</td> ????
<td>Borat</td>
</tr>
</tbody>
</table>
jcdevelopment
02-06-2008, 05:09 PM
try this and see if it works
<td style="text-align:right;">George</td>
chikna
02-06-2008, 05:48 PM
That worked. Why is it not working using COLGROUP? FireFox does not support COLGROUP? Thanks.
jcdevelopment
02-06-2008, 07:30 PM
Im not too sure why, but i know setting a style to that specific td will force it you could, if you wanted it on everyone, do this:
td {
text-align:right;
}
or
.alignment {
text-align:right;
}
<td class="alignment">Content</td>
either one should be good, its just that you want to make everything work in FF(good practice) then hack it in IE. One of these days every browser will live as one, atleast we can only hope!
Apostropartheid
02-06-2008, 07:33 PM
<colgroup
Close the tag and see what happens?
jcdevelopment
02-06-2008, 07:38 PM
good call cyan, i didnt even see that.
Andrew Johnson
02-06-2008, 10:18 PM
Not sure if you did a direct copy and paste or not, if you did you forgot a ">" to close your COLGROUP tag.
If not, then I am stumped.
chikna
02-07-2008, 05:09 AM
It's not a copy and paste it's a typo. I did have <COLGROUP> blah blah </COLGROUP>
oceanshailesh
02-25-2009, 07:06 AM
Tried on IE5, IE6, Firefox, Chrome, Opera, Netscape. It works on all these Browsers.
The only thing we need to take care is to define the ie property first and then the mozilla property.
i.e.: text-align:-moz-right; text-align:right;
The other way around it fails in IE
Here are the properties for Firefox
* text-align ( -moz-center; -moz-left; -moz-right; )
<style>
.alignRight {
text-align:-moz-right;
text-align:right;
}
.alignLeft {
text-align:-moz-left;
text-align:left;
}
.alignCenter {
text-align:-moz-center;
text-align:center;
}
/* HTML Properties */
table{
width:100%;
}
tr{
width:100%;
}
</style>
<body>
<table>
<tr> <td class="alignRight" > Right </td> </tr>
<tr> <td class="alignCenter" > Center </td> </tr>
<tr> <td class="alignLeft" > left </td> </tr>
<tr> <td class="alignRight" > Right </td> </tr>
<tr> <td class="alignCenter" > Center </td> </tr>
<tr> <td class="alignLeft" > left </td> </tr>
</table>
</body>
Please let me know if it doesn't work in any of the browsers
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.