Why a table is not created complete?

1

Question oriented to HTML and CSS .

At the moment I am creating a table by means of a SELECT of a DB, however I have noticed that the table is not created complete, and even if an exception does not jump the page is incomplete.

Try with style "<div style='overflow:auto'>"

And it works vertical ... but not horizontal ... what should I correct?

This tag was tested in the code not in the stilo css sheet.

ResultSet lista = (ResultSet)request.getAttribute( "lista" );
if(lista != null)
{
    if( lista.first())
    {
        lista.beforeFirst();
        out.println("<form method='post' action=''>"
            + "<div style='overflow:auto'>"       
            + "<table border ='2px' align='center' id='tableedit' >"
            + "<caption align='center'> OFICINAS EN BD </caption>"
            + "<tr>"
            + "<th>NOMBRE OFICINA</th>"
            + "<th>ZONA</th>" 
            + "<th>CIUDAD</th>"        
            + "<th>EDITAR</th>"
            + "<th>ELIMINAR</th>"
            + "</tr>");

        while( lista.next( ) )
        {
            //Modificamos el ID de la zona por el nombre para la vista
            String z = lista.getString( 3 );
            String nz = "";
            if (!z.equals(""))
            {
                ResultSet droplst3 = s.consultarZonas( 1 , z );
                droplst3.first();//Primera coincidencia
                nz = droplst3.getString( 2 );
                droplst3.close();
            }

            //Modificamos el ID de la ciudad por el nombre para la vista
            String ciudad = lista.getString( 4 );                                                                                  
            String nc = "";

            if(!ciudad.equals(""))
            {
                String c = ciudad;   
                ResultSet droplst4 = s.consultarCiudades( 1 , c );
                droplst4.first();//Primera coincidencia
                nc = droplst4.getString( 2 );
                droplst4.close();
            }

            out.println("<tr>"
              + "<td >" + lista.getString( 2 ) + "</td>" 
              + "<td  id='editable'>" + nz + "</td>"
              + "<td  id='editable'>" + nc + "</td>"        
              + "<td><a href='editarOficina.jsp?IdO="+ lista.getInt( 1 ) +" &nomO="+ lista.getString( 2 ) +" &IdZ="+ lista.getString( 3 ) +"&IdC="+ lista.getString( 4 ) +"'>"
                      + "<img src='IMG/editarCampo.png' width='25' height='25'></td>"
              + "<td><a href='eliminarOficina.jsp?IdO="+ lista.getInt( 1 ) +" &nomO="+ lista.getString( 2 ) +" &IdZ="+ lista.getString( 3 ) +"&IdC="+ lista.getString( 4 ) +"'>"
                      + "<img src='IMG/eliminarCampo.png' width='25' height='25'></td>"         
              + "</tr>"); 
        }   
        out.println("</table>");
        out.println("</div>");
        out.println("</form>");
    }
}
    
asked by Andres Felipe Diaz 04.04.2017 в 22:18
source

0 answers