Display 2 ArrayLists in HTML table -


I need some help with the M-school project.

I have 2 array lists of objects. A student is with objects, with a course object.

Every ArrayList actually has a table with DB (the teacher was asked to do this).

  A table student (student_ind INT primary key, name VARCHAR, year INT), is a table course (course IID primary key, title VARHAR).   

I need to display 2 tables (2 array list) in an HTML table.

This code only gives table headers.

  & lt; Table range = "1" cell exposure = "1" cellpadding = "8" bg color = # ebdd2> & Lt; TR & gt; & Lt; Td bgcolor = # FF9966 & gt; & Lt; B & gt; Id & lt; / B & gt; & Lt; / Td> & Lt; Td bgcolor = # FF9966 & gt; & Lt; B & gt; Title & lt; / B & gt; & Lt; / Td> & Lt; TD & gt; & Lt; / TD & gt; & Lt; Td bgcolor = # FF9966 & gt; & Lt; B & gt; Id & lt; / B & gt; & Lt; / Td> & Lt; Td bgcolor = # FF9966 & gt; & Lt; B & gt; Name & lt; / B & gt; & Lt; / Td> & Lt; Td bgcolor = # FF9966 & gt; & Lt; B & gt; Year & lt; / B & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; For & lt;% (Course CS: Courses) {%> & Lt; Td> & Lt;% = cs.getCourse_id ()% & gt; & Lt; / Td> & Lt; Td> & Lt;% = cs.getTitle ()% & gt; & Lt; / Td> & Lt; TD & gt; & Lt; / TD & gt; & Lt;%}% & gt; For & lt;% (Student Student: Students) {%> & Lt; Td> & Lt;% = st.getStudent_id ()% & gt; & Lt; / Td> & Lt; Td> & Lt;% = st.getName ()% & gt; & Lt; / Td> & Lt; Td> & Lt;% = st.getYear ()%> & Lt; / Td> & Lt; / TR & gt; & Lt;%}% & gt; & Lt; / Table & gt; & Lt; / Body & gt;   

Thank you in advance!

I solved it:

   & Lt; Option value = "& lt;% = st.getStudent_id ()%>" & Gt; & Lt;% = st.getStudent_id ()% & gt; & Lt; / Options & gt; & Lt;%}% & gt; & Lt; / Select & gt; & Lt; / TD & gt; & Lt; Td> & Lt; Input type = "submit" value = "link" /> & Lt; / Td> & Lt; TD & gt; & Lt; Choose multiple names = "cid" size = "5" & gt; For & lt;% (Course CS: Courses) {%> & Lt; Option value = "& lt;% = cs.getCourse_id ()%> & Gt; & Lt;% = cs.getCourse_id ()% & gt; & Lt; / Options & gt; & Lt;%}% & gt; & Lt; / Select & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;    

Comments