fba*_*bas 4 html whitespace internet-explorer textarea
FF和Chrome的表现很好,但IE(8)没有保留我的格式化代码中的空格我正在放入TEXTAREA
<textarea id="vdt_table_textarea" style="white-space: pre"></textarea>
Run Code Online (Sandbox Code Playgroud)
和
var vdt_demo_table_string = '<table id="example" class="display">\n\
<thead>\n\
<tr>\n\
<th>Rendering engine</th>\n\
<th>Browser</th>\n\
<th>Platform(s)</th>\n\
<th>Engine version</th>\n\
<th>CSS grade</th>\n\
</tr>\n\
</thead>\n\
etc....
';
$(document).ready(function() {
$('#vdt_table_textarea').html(vdt_demo_table_string.replace(' ', ' '));
});
Run Code Online (Sandbox Code Playgroud)
我怎样才能让IE尊重我的权威?!
小智 7
CSS
textarea{
white-space:pre;
}
Run Code Online (Sandbox Code Playgroud)
要么
textarea{
white-space:pre-wrap;
}
Run Code Online (Sandbox Code Playgroud)