Link to home
Start Free TrialLog in
Avatar of aman0711
aman0711

asked on

Mouse Over functionality

Hi Experts,
         
           I have the attached table on my jsp page. As you can see, this is not a pretty table. What I want to achieve is that:
     * Right now I am displaying an equation like 10/100=10%.
 
     What I want is: Just to display 10% in every cell but when a user rolls his mouse over the value, it should display the calculation 10/100=10% in a small pop up like display.

      Right now I have no clue how to do this. please help me out.
     
Tabbbbb.PNG
ASKER CERTIFIED SOLUTION
Avatar of avdej
avdej
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aman0711
aman0711

ASKER

Thank you Avdej :-)
Thank you so much :-)
Code and snapshot to be replaced in the question:



<table border="1" cellspacing="1" bgcolor="#FFFFFF" style="font-size:0.9em" width="500">
        <tr>
                <th align="center"><b>App</b></th>
                <%
                        Calendar cal = Calendar.getInstance();
                        SimpleDateFormat sdf = new SimpleDateFormat("MMM");
                        cal.set(Calendar.MONTH, Calendar.JULY);
                        for (int i = 0; i < 12; i++) {
                                  java.util.Date month = cal.getTime();
                                 
                                                                    
                %>
                <TH align="center"><%=sdf.format(month)%></TH>
                <%
                            
                        cal.roll(Calendar.MONTH, 1);
                        }
                %>
        </tr>
        <%
                Connection conn = null;
                conn = db.getConnection();
                       
                String sql = "";
                PreparedStatement pstmt, subpstmt = null;
                ResultSet rs, rs1 = null;
 
                sql = "Select DISTINCT App from SAMPLE_TABLE";
                pstmt = conn.prepareStatement(sql);
                rs = pstmt.executeQuery();
                while (rs.next()) {
        %>
        <TR><TD><%=rs.getString(1)%></TD>
                <%
                                String subquery = "Select * from( Select * from SAMPLE_TABLE2 WHERE APPL IN ('"
                                + rs.getString(1)
                                + "') ORDER BY YEAR , DECODE(UPPER(MONTH), 'JAN', 7, 'FEB', 8, 'MAR', 9, 'APR', 10, 'MAY', 11, 'JUN', 12, 'JUL', 1, 'AUG', 2, 'SEP', 3, 'OCT', 4, 'NOV', 5, 'DEC', 6) ) WHERE ROWNUM<=12 and ASP='xyz'";
                                subpstmt = conn.prepareStatement(subquery);
                                rs1 = subpstmt.executeQuery();
                                while (rs1.next()) {
                %>
                <%
                        int totalMetrics = rs1.getInt(6);
                        %>
                <TD align="center"><%= totalMetrics==0 ? "NA" :  (rs1.getInt(5)+"/"+rs1.getInt(6)+"="+rs1.getFloat(7)+"%") %></TD>
                <%
                }
                %>
        </TR>
        <%
                }
                rs.close();
                rs1.close();
                pstmt.close();
                subpstmt.close();
                conn.close();
        %>
</table>

Open in new window

Tabbbbb.PNG