Solved

having problem with table in a jsp

Posted on 2006-07-13
2
252 Views
Last Modified: 2010-04-01
Hi I need a table to look like this
-----------------------------------------------------------------------------------------------------------
Name / Title                                          Phone / Email        
(line)------------------------------------------------------------------------------------(line)
Steven-Stern test-ccim , CCIM             312-321-4512
  (no line here)                                 Send Email                         Image(spanned over 6 rows)
  Chief Snack Officer                                    
  430 N. Michigan Ave.
  Suite 800
  Chicago, IL 60611
-------------------------------------------------------------------------------------------------------------
but it comes out to be like this
-------------------------------------------------------------------------------------------------------------
Steven-Stern test-ccim , CCIM         312-321-4512
 (line)
  Chief Snack Officer                             Send Email       
  430 N. Michigan Ave.
  Suite 800
  Chicago, IL 60611                                                                  ( image over here)
-------------------------------------------------------------------------------------------------------------

Any help will be greatly appreciated
it also prints lnes between each person 's data. I need a line onle between all the data

here's my code
______________________________________________________________________________
 <tr>
            <td>
              <table width="508">
                    
                  <!-- To get rid of Null values -->        
                  <%!
                        public String checkNull(String theValue){
                        return ( theValue == null ) ? "" : theValue;
                  }
                  %>

                  <% if(message != null) { out.println("<br><span class='message_text'>" + message + "</span>"); } %>

                  <%
                        if(search_results.size() > 0) { %>
                              <tr height="25">
                                    <%-- <td bgcolor="#989898" nowrap>&nbsp;&nbsp;<a class="title_link" href="<%=chapter_name%>?action=search_members&first_name=<%= first_name %>&last_name=<%= last_name %>&city=<%=city%>&state=<%=state%>&ccim_status=<%=ccim_status%>&order_by=first_name">First Name</a>&nbsp;&nbsp;</td>
                                    <td bgcolor="#989898" nowrap>&nbsp;&nbsp;<a class="title_link" href="<%=chapter_name%>?action=search_members&member_id=<%= member_id %>&first_name=<%= first_name %>&last_name=
                                    <%= last_name %>&city=<%=city%>&state=<%=state%>&ccim_status=<%=ccim_status%>&order_by=last_name">Last Name</a>&nbsp;&nbsp;</td> --%>
                                    
                                    <th align = 'left'>Name / Title</th>
                                    <th align = 'left'>Phone / Email</th>
                                    <th></th>

                              </tr>
                              <%
                                    String bgcolor = "#F0F0F0";
                                    while(result_iterator.hasNext()) {
                                          ChapterMember next_record = (ChapterMember)result_iterator.next();
                              %>
                                    <tr>
                                          <td>
                                                <tr>
                                                      <td nowrap><a href="<%=chapter_name%>?action=show_memberDetail&eid=<%= next_record.getMember_ID() %>"><%=next_record.getFirst_name()%> <%=next_record.getLast_name()%>
                                                      <%if(next_record.getMember_class().equals("DESIGNEE")){%>, CCIM<%}%></a>
                                                      </td>
                                                      <td><%=next_record.getPhone1()%></td>
                                                      <td></td>

                                                </tr>
                                                <tr>
                                                      <td nowrap>&nbsp;&nbsp;<%=next_record.getTitle()%></td>
                                                      <td><a href="mailto:<%=next_record.getEmail()%>">Send Email</a></td>
                                                      <td></td>
                                                </tr>
                                          
                                                      <%
                                                            if(!checkNull(next_record.getAddress1()).equals("")) { %>
                                                            <tr><td>&nbsp;&nbsp;<%= next_record.getAddress1()%></td></tr>
                                                      <% } %>


                                                      <%
                                                            if(!checkNull(next_record.getAddress2()).equals("")) { %>
                                                            <tr><td>&nbsp;&nbsp;<%= next_record.getAddress2()%></td></tr>
                                                      <% } %>


                                                      <%
                                                            if(!checkNull(next_record.getCity()).equals("")) { %>
                                                            <tr><td>&nbsp;&nbsp;<%= next_record.getCity()%>, <%=next_record.getState()%> <%=next_record.getZip()%></td></tr>
                                                      <% } %>


                                                      <%
                                                            if(!checkNull(next_record.getCountry()).equals("") && !checkNull(next_record.getCountry()).equals("United States")) { %>
                                                            <tr><td>&nbsp;&nbsp;<%= next_record.getCountry()%> </td></tr>
                                                      <% } %>
                                          <tr><td></td><td></td>
                                          <td rowspan ='4'>
                                          <img src ="http://www.ccim.com/services/member/profile/pictures/<%=next_record.getMember_ID()%>.jpg" width="45" height="65">
                                          </td>
                                    </tr>
                                    <tr>
                                                      <td bgcolor=<%=bgcolor%> colspan ='4'></td>
                                    </tr>
                                                <%}%>

                                    <%}%>
                   </table>
               </td>
         </tr>

----------------------------------------------------------------------------------------------------------------------------------

0
Comment
Question by:huzefaq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Expert Comment

by:gops1
ID: 17105199
Similar post you see here:

http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_21918855.html

Let me know if what I have suggested is OK
0
 
LVL 2

Accepted Solution

by:
pankilmpatel earned 500 total points
ID: 17106206
Hi,

I have work our with your code and find some problem with code...

1. You misplace the Header Tag.
2. You misplace the Image Part.

please change your code as per following.. and let me know if you have any problem.


 <tr>
            <td>
              <table width="508">

           <th align = 'left'>Name / Title</th>
            <th align = 'left'>Phone / Email</th>
            <th></th>
                 
               <!-- To get rid of Null values -->        
               <%!
                    public String checkNull(String theValue){
                    return ( theValue == null ) ? "" : theValue;
               }
               %>

               <% if(message != null) { out.println("<br><span class='message_text'>" + message + "</span>"); } %>

               <%
                    if(search_results.size() > 0) { %>
                         <tr height="25">
                              <%-- <td bgcolor="#989898" nowrap>&nbsp;&nbsp;<a class="title_link" href="<%=chapter_name%>?action=search_members&first_name=<%= first_name %>&last_name=<%= last_name %>&city=<%=city%>&state=<%=state%>&ccim_status=<%=ccim_status%>&order_by=first_name">First Name</a>&nbsp;&nbsp;</td>
                              <td bgcolor="#989898" nowrap>&nbsp;&nbsp;<a class="title_link" href="<%=chapter_name%>?action=search_members&member_id=<%= member_id %>&first_name=<%= first_name %>&last_name=
                              <%= last_name %>&city=<%=city%>&state=<%=state%>&ccim_status=<%=ccim_status%>&order_by=last_name">Last Name</a>&nbsp;&nbsp;</td> --%>

 <td rowspan ='4'>
                                   <img src ="http://www.ccim.com/services/member/profile/pictures/<%=next_record.getMember_ID()%>.jpg" width="45" height="65">
</td>
                             

                         </tr>
                         <%
                              String bgcolor = "#F0F0F0";
                              while(result_iterator.hasNext()) {
                                   ChapterMember next_record = (ChapterMember)result_iterator.next();
                         %>
                              <tr>
                                   <td>
                                        <tr>
                                             <td nowrap><a href="<%=chapter_name%>?action=show_memberDetail&eid=<%= next_record.getMember_ID() %>"><%=next_record.getFirst_name()%> <%=next_record.getLast_name()%>
                                             <%if(next_record.getMember_class().equals("DESIGNEE")){%>, CCIM<%}%></a>
                                             </td>
                                             <td><%=next_record.getPhone1()%></td>
                                             <td></td>

                                        </tr>
                                        <tr>
                                             <td nowrap>&nbsp;&nbsp;<%=next_record.getTitle()%></td>
                                             <td><a href="mailto:<%=next_record.getEmail()%>">Send Email</a></td>
                                             <td></td>
                                        </tr>
                                   
                                             <%
                                                  if(!checkNull(next_record.getAddress1()).equals("")) { %>
                                                  <tr><td>&nbsp;&nbsp;<%= next_record.getAddress1()%></td></tr>
                                             <% } %>


                                             <%
                                                  if(!checkNull(next_record.getAddress2()).equals("")) { %>
                                                  <tr><td>&nbsp;&nbsp;<%= next_record.getAddress2()%></td></tr>
                                             <% } %>


                                             <%
                                                  if(!checkNull(next_record.getCity()).equals("")) { %>
                                                  <tr><td>&nbsp;&nbsp;<%= next_record.getCity()%>, <%=next_record.getState()%> <%=next_record.getZip()%></td></tr>
                                             <% } %>


                                             <%
                                                  if(!checkNull(next_record.getCountry()).equals("") && !checkNull(next_record.getCountry()).equals("United States")) { %>
                                                  <tr><td>&nbsp;&nbsp;<%= next_record.getCountry()%> </td></tr>
                                             <% } %>
                              <tr>
                                             <td bgcolor=<%=bgcolor%> colspan ='4'></td>
                              </tr>
                                        <%}%>

                              <%}%>
                </table>
             </td>
         </tr>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lamba in java 8 9 252
maven project jars 7 58
going to wrong jsp page 2 46
DTD and JAVA versions 1 28
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question