I want a long code to wrap inside the TD and the div It does this in Chrome, but I work it in Firefox can not do. In Firefox, the text just keeps going in the next TD element, will someone help me there? Other comments are also welcome on my code (like "do not use multiple divisions" or anything else)
& Lt; Td class = "code" & gt; & Lt; Div class = "divCode" & gt; & Lt; Code & gt; Error = estimate - n / guessjfdklsjf dklsjf kdlsjfkldsjfkl dsjfklds jfkldsjfkljdsa; Lfkjdsakl; Fjdskla; Fjdksl; Ajfkld; Sajfkl; Dsajfkl; Dsa & lt; Td square = "other class" & gt; Other stuff here & lt; / Td> & Lt; / Code & gt; & Lt; / Div & gt; & Lt; / TD & gt; & Lt; / TR & gt; This is styled by the following CSS:
.line TD {padding-right: 10px; Padding-left: 10px; Font-family: monospace; Word-wrap: break-word; Max-width: 40 x; } .code {White-space: East; Max-width: 40 x; } .divCode {max-width: 40x; } Code {max-width: 40 x; Word-wrap: breaking words; } Thanks, - H
announcement white - Location: Prevents the wrapping, so deleting it fixes this problem, but if you want to preserve the space in the content, instead of white-space: pre-rap (Warning: no support in IE 7). Note that wrapping is not preserved indentation: If a line begins with an empty space and wrapped, then the next line starts in the first position, without any indentation. To get wrapped, which indentation (and possibly the continuous row of indents from the starting line), you need different markups: Make each logical line one element etc.
Comments
Post a Comment