In order to create a table, the following steps must be taken:
import oracle.html.*; public class dtable { public static void main (String args[]) { int MAXNUM = 10; HtmlHead hd = new HtmlHead("Dynamic Table Demo"); HtmlBody bd = new HtmlBody(); HtmlPage hp = new HtmlPage(hd, bd); hp.printHeader(); DynamicTable tab = new DynamicTable(2); TableRow rows[] = new TableRow[MAXNUM]; rows[0] = new TableRow(); rows[0].addCell(new TableHeaderCell("I")) .addCell(new TableHeaderCell("I-SQUARED")); tab.addRow(rows[0]); for (int i=1; i< MAXNUM; i++) { rows[i] = new TableRow(); rows[i].addCell(new TableDataCell(""+i)) .addCell(new TableDataCell(""+i*i)); tab.addRow(rows[i]); } bd.addItem(tab); bd.addItem(SimpleItem.HorizontalRule); hp.print(); } // end of main } // end of class dtable