mstelz
mstelz

Reputation: 640

IE9 whitespace css and alignment

The problem I am having is that I need to keep the whitespace on the TD text while still vertically aligning the text within the TD. When the white-space: pre-wrap is enabled, the text is bottom justified within the TD. And if I disable that tag then IE takes that all but one space out between each letter.

<td width="10%" class="someClass" style="white-space: pre-wrap;">    
    hh    ee  lll oooo
</td>

Here is the CSS for that

.someClass {
  text-align: left;
  text-indent: 0px;
  padding-top: 1px;
  padding-bottom: 2px;
  font-size: 1em;
}

Upvotes: 3

Views: 905

Answers (1)

BLSully
BLSully

Reputation: 5939

if you wrap your text in pre tags, your spacing should be preserved

<td width="10%" class="someClass" style="white-space: pre-wrap;">    
    <pre>hh    ee  lll oooo</pre>
</td>​

Fiddle: http://jsfiddle.net/BLSully/hb4aU/2/

Upvotes: 1

Related Questions