For Programmers: Free Programming Magazines  


Home > Archive > ASP > August 2005 > Indenting HTML code in a textarea









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Indenting HTML code in a textarea
martin.igle+ASP@gmail.com

2005-08-28, 6:55 pm

the question is simple... is there any way to indent HTML code inside a
simple textarea?...

tnx!
martin

McKirahan

2005-08-28, 6:55 pm

"martin.igle+ASP@gmail.com" <martin.igle@gmail.com> wrote in message
news:1125250515.761302.312330@z14g2000cwz.googlegroups.com...
> the question is simple... is there any way to indent HTML code inside a
> simple textarea?...
>
> tnx!
> martin


You can use Tabs or spaces with a fixed width font.


<html>
<head>
<title>ta_tab.htm</title>
</head>
<body>
<form name="form1">
<textarea name="text" cols="80" rows="10"></textarea>
<textarea name="area" cols="80" rows="10"
style="font-family:Courier">Hello World!</textarea>
</form>
<script type="text/javascript">
document.form1.text.value = "Hello\tWorld!";
</script>
</body>
</html>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com