We help IT Professionals succeed at work.

Problem of formatting HTML code in JSP of Struts framework

manyam537
manyam537 asked
on
249 Views
Last Modified: 2010-04-01
Hello,

   I have the follwing JSP:

<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="000066">
   <tr>
      <td>
        <table border="0" cellspacing="1" cellpadding="3" width="100%">
                   <tr bgcolor="#FFFFFF">
                         <th align="left">Name</th>
                        <td><%=ValidationUtil.escapeNull(firstName) + " " + ValidationUtil.escapeNull(middleName) + " " + ValidationUtil.escapeNull(lastName)%></td></tr>
                  <tr bgcolor="#FFFFFF">
                         <th align="left">Employee ID</th>
                        <td><fema:inputText name ="employeeId" value="<%=ValidationUtil.escapeHtmlChars(employeeId)%>" size ="6" length="6" tabIndex="1" view="read" checkError="true"/></td></tr>
                  
                  <tr bgcolor="#FFFFFF">
                    <th align="left"><span class="redSmall">* </span>Payment request for salary of the employee for this period  </th>
                    <td>$
                <fema:inputText name ="requestSalaryAmount" value="<%=ValidationUtil.escapeHtmlChars(requestSalaryAmount)%>" size ="10" length="10" tabIndex="3" view="<%=view%>" checkError="true"/>
                        &nbsp; <span class="smallBlue">(Numbers only)</span></td>
              </tr>
              <tr bgcolor="#FFFFFF">
                    <th align="left"><span class="redSmall">* </span>Payment request for benefits of the employee for this period  </th>
                    <td>$
                <fema:inputText name ="requestBenefitsAmount" value="<%=ValidationUtil.escapeHtmlChars(requestBenefitsAmount)%>" size ="10" length="10" tabIndex="3" view="<%=view%>" checkError="true"/>
                        &nbsp; <span class="smallBlue">(Numbers only)</span></td>
              </tr>
            </table>
        </td>
      </tr>
</table>


After every <tr> tag, I am getting one horizontol line. I have to remove the horizontol line between the last two <tr> s. That is between  "Payment request for salary of the employee for this period" and "Payment request for benefits of the employee for this period ". And I have to add heading before them.

Thanx,
TirupatiReddy Manyam

Comment
Watch Question

Commented:
Last two <tr>s? Use <logic:equal> to check if you're approaching the
end and don't display the horizontal line.

________
radarsh
I do not get what you mean...can you explain it in more depth?

David

Author

Commented:
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="000066">
   <tr>
      <td>
        <table border="0" cellspacing="1" cellpadding="3" width="100%">
               
                   <tr bgcolor="#FFFFFF">
                         <th align="left">Name</th>
                        <td><%=ValidationUtil.escapeNull(firstName) + " " + ValidationUtil.escapeNull(middleName) + " " + ValidationUtil.escapeNull(lastName)%></td></tr>
                        
                                      
                  <tr bgcolor="#FFFFFF">
                    <th align="left" colspan="2"><span class="redSmall">* </span>Payment request for the employee for this period  </th>
                  
                   </tr>
                  <tr bgcolor="#FFFFFF">
                    <th align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Request for salary </th>
                    <td>$
                <fema:inputText name ="requestSalaryAmount" value="<%=ValidationUtil.escapeHtmlChars(requestSalaryAmount)%>" size ="10" length="10" tabIndex="3" view="<%=view%>" checkError="true"/>
                        &nbsp; <span class="smallBlue">(Numbers only)</span></td>
              </tr>
              <tr bgcolor="#FFFFFF">
                    <th align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Request for benefits  </th>
                    <td>$
                <fema:inputText name ="requestBenefitsAmount" value="<%=ValidationUtil.escapeHtmlChars(requestBenefitsAmount)%>" size ="10" length="10" tabIndex="3" view="<%=view%>" checkError="true"/>
                        &nbsp; <span class="smallBlue">(Numbers only)</span></td>
              </tr>
             
            
        
         </table>
        </td>
      </tr>
</table>



So in the above page I am getting horizontol lines as I put border in the table. So what I want to is remove the horizontol line after this code:
<tr bgcolor="#FFFFFF">
                    <th align="left" colspan="2"><span class="redSmall">* </span>Payment request for the employee for this period  </th>
                  
                   </tr>


Thanx,
TirupatiReddy Manyam
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi radarsh,

   Yes there are some css style sheets that are used.

Thx,
TirupatiReddy
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.