我可以做什么来使其打印像在Web浏览器的HTML文档中看起来?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Example</title> </head> <body> ###### # # ## # # ##### # ###### # # # # # ## ## # # # # ##### ## # # # ## # # # # ##### # ## ###### # # ##### # # # # # # # # # # # # ###### # # # # # # # ###### ###### </body> </html>
得到:
# # ## # # ##### # ###### # # # # # ## ## # # # # ##### ## # # # ## # # # # > ##### # ## ###### # # ##### # # # # # # # # # # # # ###### # # # # # # # ###### ######
解决方法
使用< pre>标签!在你的例子之前和之后。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Example</title> </head> <body> <pre> ###### # # ## # # ##### # ###### # # # # # ## ## # # # # ##### ## # # # ## # # # # ##### # ## ###### # # ##### # # # # # # # # # # # # ###### # # # # # # # ###### ###### </pre> </body> </html>