Professional Documents
Culture Documents
SQL HTML
SQL HTML
dao;
import java.util.List;
public SqlHtml() { }
if (list != null) {
tabla.append("<table class=\"tablaQry\">");
// imprimiendo titulos
Object[] fila = (Object[]) list.get(0);
tabla.append("<thead>");
tabla.append("<tr>");
for (int col = 0; col < fila.length; ++col) {
tabla.append("<td>" + fila[col].toString() + "</td>");
}
tabla.append("</tr>");
tabla.append("</thead>");
// imprimiendo data
for (int fil = 1; fil < list.size(); fil++) {
fila = (Object[]) list.get(fil);
String fx = (fil % 2) == 1 ? "f1" : "f2";
tabla.append("<tr class=\"" + fx
+ "\" onmouseover=\"ilumina(this)\"
onmouseout=\"restaura(this,'"
+ fx + "')\">");
return tabla.toString();
}
if (list != null) {
// tabla con combo
tabla.append("<table class=\"tablaQryCrud\">");
tabla.append("<tr>");
tabla.append("<td style=\"text-align:left;width:160px\"> ");
tabla.append("<select id=\"numPagina\" onchange=\"js_query()\">");
tabla.append("</select>");
tabla.append("</td>");
tabla.append("<td style=\"text-align:center;font-weight:bold\">");
tabla.append(titulo);
tabla.append("</td>");
tabla.append("<td style=\"text-align:right;width:160px\">");
tabla.append("<a href=\"#\" onclick=\"js_insert()\">ins</a> ");
tabla.append("</td>");
tabla.append("</tr>");
tabla.append("</table>");
tabla.append("</tr>");
tabla.append("</thead>");
// imprimiendo data
for (int fil = 1; fil < list.size(); fil++) {
fila = (Object[]) list.get(fil);
String fx = (fil % 2) == 1 ? "f1" : "f2";
tabla.append("<tr class=\"" + fx
+ "\" onmouseover=\"ilumina(this)\"
onmouseout=\"restaura(this,'"
+ fx + "')\">");
tabla.append("<td style=\"text-align:center\">");
tabla.append("<input type=\"radio\" name=\"crud_upd\"
id=\"crud_upd\" value=\"" + fila[0].toString() + "\">");
tabla.append("</td>");
tabla.append("<td style=\"text-align:center\">");
tabla.append("<input type=\"checkbox\" name=\"crud_del\"
id=\"crud_del\" value=\"" + fila[0].toString() + "\">");
tabla.append("</td>");
tabla.append("</tr>");
}
tabla.append("</table>");
} else {
tabla.append("Consulta mal hecha o no hay conexion");
}
return tabla.toString();
}
}