How do you write specific data to an HTML table?

Printing a processed data in html table <td> tags?

  • int a=10; int b=20; int c=a*c; out.println("<table border='1'>"); out.println("<tr>"); out.println("<td>Amount Payable</td>"); out.println(c); <---------------------------------------… i hav to print the vaule of 'c' i.e. 200) out.println("</tr>"); out.println("<tr>"); out.println("<td>Another attribute</td>"); out.println(print values);<-------------------------------… another value here) out.println("</tr>"); out.println("</table>"); its a servlet programming. if the c is enclosed with <td> </td> tags the CHARACTER 'c' prints and not the value. is it possible to print the VALUE of c

  • Answer:

    Something like this should work: out.println("<td>" + c + "</td>");

Yashwant... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.