IE7 Problem with break word and max width on tables

This is the code
on Firefox, Chrome I see it works great it breaks the word when it needs to…
but on IE7 for some reason it doesn’t work…

Its like that:

Firefox / Chrome:
AAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAA

and on IE7:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

how can I fix that? im trying for like 2 days :\


			<div class="block">
			
				<h1><?= $mainsubj ?></h1>
				<p>
				<table width="600">
				<tr ><td style="width: 600px; max-width:600px; word-wrap: break-word;">
					<?= $maindesc ?>
				</td></tr></table>
				</p>
			</div>
			<div class="block">
				<h2><?= $mainsubj2 ?></h2>
				<p>
				<table width="600">
				<tr ><td style="width: 600px; max-width:600px; word-wrap: break-word;">
				<?= $maindesc2 ?>
				</td></tr></table>
				</p>
			</div>

Hi,

For starters, it’s illegal to nest a table (or any other block element) in a <p> tag.

A quick test shows that IE does not want to cooperate when word-wrap is applied directly to the td. However if you nest the text in a <p> tag within the td and hook the styles to it IE cooperates.

Strange though, IE needs width and max-width to have the same values to prevent excess space after the word-break.
EDIT: That seems to work in IE8 but IE7 is still leaving excess space after the word break, as if it did not break.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test Page</title>

<style type="text/css">
table {
background:#EEF;
}
td p {
width:400px;
max-width:400px;
word-wrap: break-word;
}
</style>

</head>
<body>

<div class="block">
    <h1>H1 Heading</h1>
    <table>
        <tr >
            <td>
                <p>ArealllllllllllllllllllyLooooooonnnnnnnnnggggggggggggWooooooorrrrrrrrrrrddddddd</p>
            </td>
        </tr>
    </table>
</div>

</body>
</html>

so what to I need to do to make it work? since I am still having this problem even
when using you’re code :\