PDA

View Full Version : How to create an ALT Character Table


rsci
01-30-2003, 06:36 PM
Since alt is 3 letters and is not searchable...

Anyone ever created an ALT character table in javascript? (ALT characters being a combination of ALT and a number sequence.)

Thanks,

whammy
01-31-2003, 12:28 AM
http://www.asciitable.com

tempest1
01-31-2003, 06:48 AM
<script>
document.write('<center><h1>Usefule HTML Character Reference Chart</h1><br><')
for(i=31;i<=500;i++)
{
document.write('<b>&#'+i+'; &nbsp;&nbsp;<u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>&nbsp;&nbsp &#'+i+';</u><br>')
}
</script>


This should encompass most of the alt characters... the spaces need to be &nbsp; but the forum is replacing them all, o well.

rsci
01-31-2003, 06:54 PM
That will provide the html characters but I don't believe its the same things. There are 3 and 4 digit alt characters. For example, open Word, press and hold Alt and type 0159 and release alt. If you typed 159 there would be a different character.

Are these alt characters the same as &# html chars?

tempest1
01-31-2003, 07:44 PM
Not sure, think so.

A1ien51
01-31-2003, 08:31 PM
Now the codes differ for each different font......
here is the code i use, it is ugly, and takes awhile for the computer to write it.

Also if you are on a windows machine...ever use character map?
start--->run--->Type in: charmap



<html>
<head>
</head>
<body>
<script>
Code='<table border="1" cellpadding="1" cellspacing="0" align="center">'
Code+=' <tr>\n <td align="center"> Code </td><td align="center">Character</td>\n <td align="center"> Code </td><td align="center">Character</td>\n <td align="center"> Code </td><td align="center">Character</td>\n <td align="center"> Code </td><td align="center">Character</td>\n <td align="center"> Code </td><td align="center">Character</td>\n </tr>\n';
min=33;
max=360;
n = new Array();
for(i=min;i<max;i++){
j = new Array(i,i+max,i+max*2,i+max*3,i+max*4);

for(k=0;k<j.length;k++){
if(j[k]<100)n[k]="00"+j[k];
else if(j[k]<1000)n[k]="0"+j[k];
else n[k]=j[k];
}
Code+=' <tr>\n <td align="center"> '+n[0]+' </td><td align="center">&#'+j[0]+'</td>\n';
Code+=' <td align="center"> '+n[1]+' </td><td align="center">&#'+j[1]+'</td>\n';
Code+=' <td align="center"> '+n[2]+' </td><td align="center">&#'+j[2]+'</td>\n';
Code+=' <td align="center"> '+n[3]+' </td><td align="center">&#'+j[3]+'</td>\n';
Code+= ' <td align="center"> '+n[4]+' </td><td align="center">&#'+j[4]+'</td>\n </tr>\n';
}
Code+="</table>";
document.write(Code);

</script>
</body>
</html>