Mega Code Archive

 
Categories / Java / JSP
 

Print ASCII Table Jsp

<%--   Copyright (c) 2002 by Phil Hanna   All rights reserved.      You may study, use, modify, and distribute this   software for any purpose provided that this   copyright notice appears in all copies.      This software is provided without warranty   either expressed or implied. --%> <%@ page session="false" %> <html> <body> <center> <h1>ASCII Table</h1> <table border="0" cellpadding="0" cellspacing="0"> <%    StringBuffer sb = new StringBuffer();    sb.append("<tr>");    sb.append("<th width=\"40\">&nbsp;</th>");    for (int col = 0; col < 16; col++) {       sb.append("<th>");       sb.append(Integer.toHexString(col));       sb.append("</th>");    }    sb.append("</tr>");    for (int row = 0; row < 16; row++) {       sb.append("<tr>");       sb.append("<th>");       sb.append(Integer.toHexString(row));       sb.append("</th>");       for (int col = 0; col < 16; col++) {          char c = (char)(row * 16 + col);          sb.append("<td width=\"32\" align=\"center\">");          sb.append(c);          sb.append("</td>");       }       sb.append("</tr>");    }    out.println(sb); %> </table> </center> </body> </html>                     PrintASCIITableJsp.zip( 88 k)