- 첫번째 방법
 
1. 입력 폼에서 textarea에 "wrap=hard"라는 프라퍼티를 써주고,
<textarea wrap="hard" name="content"></textarea>
 
2. DB에 저장되어 있는 글을 보여줄 때는 <pre> 태그를 사용합니다.
<td><pre><%=RS("content")%></pre></td>

- 두번째 방법 : Replace()를 이용합니다.
 
1. 입력폼의 <textarea>에서 입력한 내용(content)을 아래와 같이 변환합니다. 그리고 나서 DB에 저장하지요.
content= Replace(Request("content"), Chr(13)&Chr(10), "<br>")
 
2. 글을 보여줄 때는 그냥 보여주면 됩니다.(<pre> 태그 사용하지 않음.)
<td><%=RS("content")%></td>
 
3. 글을 수정하는 폼에서 내용(content)를 보여줄 때는 다시 변환을 해주어야 합니다.
<textarea name="content"><%=Replace(RS("content"), "<br>", Chr(13)&Chr(10))%></textarea>


출처:

http://coolmsd.tistory.com/35





-  추가 : 실습 결과

wrap=hard를 입력폼에 넣지 않아도 볼 때 띄어쓰기가 먹혀서 나옴

아래는 pre tag 정의임

The <pre> tag defines preformatted text.

Text in a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks.

Posted by 타다키치
,