My lengthy code won't wrap properly inside the td and div elements. It works fine in Chrome, but Firefox isn't cooperating. Any tips on how to fix this issue? I'm also open to other suggestions for improving my code (e.g. "reduce your use of divs").
<tr class="line">
<td class="lineNumber">38</td>
<td class="code"><div class="divCode"><code> error = guess - n/guessjfdklsjf dklsjf kdlsjfkldsjfkl dsjfklds jfkldsjfkljdsa;lfkjdsakl;fjdskla;fjdksl;ajfkld;sajfkl;dsajfkl;dsa
<td class="otherClass">other stuff here</td>
</code></div></td>
</tr>
The CSS used to style the above code is as follows:
.line td{
padding-right: 10px;
padding-left: 10px;
font-family: monospace;
word-wrap: break-word;
max-width: 40ex;
}
.code {
white-space: pre;
max-width: 40ex;
}
.divCode {
max-width: 40ex;
}
code {
max-width: 40ex;
word-wrap:break-word;
}
Appreciate any help, --h