To grasp the functioning of jQuery Mobile pages, it's crucial to understand that the header and footer have fixed height values while the content is flexible. The content will adjust its size based on its inner content rather than automatically resizing to fill the remaining space below the header and above the footer. This creates the white space you've observed.
Two solutions are available for your issue: a CSS-based solution and a JavaScript-based one.
CSS Solution:
.ui-content {
padding: 0;
position: absolute !important;
top : 40px !important;
right : 0;
bottom : 40px !important;
left : 0 !important;
}
The 40px value accounts for the header and footer heights; set it to 0 if they're not needed.
View working example here.
JavaScript Solution:
function getRealContentHeight() {
var header = $.mobile.activePage.find("div[data-role='header']:visible");
var footer = $.mobile.activePage.find("div[data-role='footer']:visible");
var content = $.mobile.activePage.find("div[data-role='content']:visible:visible");
var viewport_height = $(window).height();
var content_height = viewport_height - header.outerHeight() - footer.outerHeight();
if((content.outerHeight() - header.outerHeight() - footer.outerHeight()) <= viewport_height) {
content_height -= (content.outerHeight() - content.height());
}
return content_height;
}
View working example here.
For more information on this topic, read further here.