The only quirk I had once an extra spacing that was occurring at the bottom of the page. To help this, I added overflow:hidden to the wrapper container.
Cheers
| Header |
Scrollable Body |
| Header | |
Scrollable Body | |
| Header |
Scrollable Body |
<!DOCTYPE html> <!--[if lt IE 7 ]> <html class="ie6"> <![endif]--> <!--[if IE 7 ]> <html class="ie7"> <![endif]--> <!--[if IE 8 ]> <html class="ie8"> <![endif]--> <!--[if (gt IE 8)|!(IE)]><!--> <html class=""> <!--<![endif]--> <head> <title>Floating Header</title> <style> html, body { width: 100%; height: 100%; margin: 0; padding: 0; } #container { width: 100%; height: 100%; position: relative; } #header { width: 100%; height: 120px; background: blue; position: absolute; top: 0; left: 0 } #content-scroll-container { overflow: auto; overflow-x: hidden; background: black; width: 100%; height: 100%; padding: 0; } #content { margin-top: 120px; color: white; } .tbl-whole-span { width: 100%; margin: 0; padding: 0; } .tbl-whole-span td { background: gray; } </style> </head> <body> <div id="container"> <div id="header"></div> <div id="content-scroll-container"> <div id="content"> First line of destruction <br/> <input id="btnAddLine" type="button" value="Add Line" onclick="addLine()" /> <br/> <table class="tbl-whole-span"> <tr> <td> Some table contents here. <span style="float:right">Text to the right</span> </td> </tr> </table> Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/>Some content, some content <br/> </div> </div> </div> <script> ; // Adjust content width when vert scrollbar appears function adjustWidth() { var scrollDiv = document.getElementById("content-scroll-container"); var contentDiv = document.getElementById("content"); var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; var newWidth = scrollDiv.offsetWidth - scrollbarWidth; var percentageWidth = newWidth * 100.00 / scrollDiv.offsetWidth; contentDiv.style.width = percentageWidth + "%"; } // Function to add content. This function relies on calling // adjustWidth. function addLine() { var content = document.getElementById("content"); content.innerHTML += "Line Added<br />"; // Detect version of IE here. Modify if needed. var html = document.getElementsByTagName("html")[0]; if (html.className != "") adjustWidth(); // adjust width only if class is IE } </script> </body> </html>
| id | code | dateactivity |
|---|---|---|
| 1 | 200 | 2014/06/04 |
| 2 | 200 | 2014/05/04 |
| 3 | 500 | 2014/04/04 |
| 4 | 504 | 2014/05/28 |
select STR_TO_DATE(a.period, '%m-%d-%y') as period, ifnull(a.cnt,0) total, ifnull(b.cnt,0) success, ifnull(c.cnt,0) failure from ( select date_format(dateactivity , '%m-%d-%y') period, count(*) cnt from mytable where dateactivity >= DATE_ADD(NOW(), INTERVAL -7 DAY) group by date_format(dateactivity , '%m-%d-%y') ) a left outer join ( select date_format(dateactivity , '%m-%d-%y') period, count(*) cnt from mytable where code = '200' and dateactivity >= DATE_ADD(NOW(), INTERVAL -7 DAY) group by date_format(dateactivity , '%m-%d-%y') ) b on a.period = b.period left outer join ( select date_format(dateactivity , '%m-%d-%y') period, count(*) cnt from mytable where (code != '200' or code is null) and dateactivity >= DATE_ADD(NOW(), INTERVAL -7 DAY) group by date_format(dateactivity , '%m-%d-%y') ) c on a.period = c.period ;
<dependencies> <!-- Spring dependencies --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.maven.artifact.version}</version> </dependency> <!-- JSP, Servlet, JSTL dependencies --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>${version.javax.servlet}</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>${version.javax.servlet.jsp}</version> </dependency> <dependency> <groupId>xmlbeans</groupId> <artifactId>xbean</artifactId> <version>2.2.0</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>${version.javax.servlet.jstl}</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> <scope>compile</scope> </dependency> <!-- Codehaus Jackson dependencies --> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.9.1</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-jaxrs</artifactId> <version>1.9.1</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.1</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-lgpl</artifactId> <version>1.9.1</version> </dependency> <!-- Jettison --> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>1.3.1</version> </dependency> <!-- Apache Datasource --> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.2</version> </dependency> <!-- Oracle Driver --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <finalName>myspringproject</finalName> </build> <properties> <spring.maven.artifact.version>2.5.6</spring.maven.artifact.version> <version.javax.servlet>2.4</version.javax.servlet> <version.javax.servlet.jstl>1.1.2</version.javax.servlet.jstl> <version.javax.servlet.jsp>2.1</version.javax.servlet.jsp> </properties>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Postman</title> </head> <body>
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
Intent.FLAG_ACTIVITY_CLEAR_TOP
but this didn't do the job.