使用Java程序片段动态生成表格
1 <% 2 String[] bookName = { "javaweb典型模块大全", "java从入门到放弃", "C语言程序设计" }; 3 %> 4 <table align="left" border="1px"> 5 <tr align="center"> 6 <td>编号</td> 7 <td>书名</td> 8 </tr> 9 <% 10 for (int i = 0; i < 3; i++) { 11 %> 12 13 <tr align="left"> 14 <td align="center"><%=i + 1%></td> 15 <td><%=bookName[i]%></td> 16 </tr> 17 <% 18 } 19 %> 20 </table>
God, Grant me the SERENITY, to accept the things I cannot change,
COURAGE to change the things I can, and the WISDOM to know the difference.