Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7573597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:13:21+00:00 2026-05-30T16:13:21+00:00

I am having trouble trying to print a table in HTML so that the

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:13:22+00:00Added an answer on May 30, 2026 at 4:13 pm

    I don’t understand why do you have <br/> inside the <td> element. Your code will separate each filed in something like this:

    Title:
    Dish:
    Description:
    Price:
    
    text
    text
    text
    text
    

    I think your code shuold be like this:

    <table border=0 width="75%">
    
    <thead>
        <tr>
            <th>Title</th>
            <th>Dish</th>
            <th>Description</th>
            <th>Price</th>
        </tr>
    </thead>
    <%
                for (int pos = 0; pos < list.size(); pos++) {
                    Menu menu = list.getMenuAt(pos);
    %>
    
    <tbody>
        <tr>
            <td><%= menu.getTitle()%></td>
            <td><%= menu.getDish()%></td>
            <td><%= menu.getDescription()%></td>
            <td><%= menu.getPrice()%></td>
         </tr>
    </tbody>
    
    <%
                } // end for
    %>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been having trouble searching through a MySQL table, trying to find entries
I have this array that I am having trouble traversing: print_r($menu) gives this: [Dashboard]
I am having some trouble trying to print from a file. Any ideas? Thanks
Hey all! Having a little trouble with my stack. Im trying to print each
I`m having trouble trying to optimize this query with OVER (PARTITION BY ...) because
I am having trouble trying to get iterators for inner sub-containers. Basically imagine this
I am having trouble trying to get this script to work. When I debug
I am having some trouble trying to get a report to print from a
I'm trying to run this C++ statement in python and I'm having trouble placing
I am having trouble trying to reference the properties of an object that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.