I am having trouble trying to print a table in HTML so that the items appear in the right place. At the moment I have this. This prints the data in a sort of list so everything is on a separate column.
<table border=0 width="75%">
<%
for (int pos = 0; pos < list.size(); pos++) {
Menu menu = list.getMenuAt(pos);
%>
<tr>
<tr width="80%">
<b>Title:</b><br>
<b>Dish:</b><br>
<b>Description:</b><br>
<b>Price:</b><br><br>
</tr>
</tr>
<tr>
<td width="80%">
<%= menu.getTitle()%> <br>
<%= menu.getDish()%> <br>
<%= menu.getDescription()%> <br>
<%= menu.getPrice()%> <br><br>
</td>
</tr>
<%
} // end for
%>
</table>
The menu can will have one title with many dish names, dish descriptions and prices.
I don’t understand why do you have
<br/>inside the<td>element. Your code will separate each filed in something like this:I think your code shuold be like this: