PDA

View Full Version : IE 7 centers my text



sibo32000
02 Jun 2007, 08:25 AM
I have just built an html website using tables and a attached css style sheet using Dreamweaver 8.

The text in the tables is aligned to the left and the whole webpage is centered in the browser using the div tag.

When I open the web page in Firefox it works fine i.e: it centers the web page and aligns the table text to the left.

But in IE7 it's a different kettle of fish as it centers the web page but then centers the text in the table.

I have tried removing the DIV tag and changing attributes in the css file but nothing seems to work.

Any ideas?

Wickham
02 Jun 2007, 08:57 AM
Try <table style="width: 750px; margin: auto; text-align: left">.......</table>
if your table is not in a containing div

or if your table is inside a div tag this may also work:-

<div style="width: 750px; margin: auto; text-align: left;">
<table>......</table>
</div>

or
<div style="width: 750px; margin: auto;">
<table style="text-align: left;">......</table>
</div>

The div with a fixed width with margin: auto will centralise on the page but the text should align to the left.

You may have to delete any other alignments like align="left" and align="center" in case they co***ict. Without seeing your code I can't be sure what will work.