Question

I'm using jQuery Mobile layout grids with 2 columns but there's a space gap when the cell's height is different.

Example:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>jQueryMobile Demos</title>                         
        <link type="text/css" rel="stylesheet" href="jquery.mobile-1.0a4.min.css" />
        <script type="text/javascript" src="jquery-1.5.2.min.js"></script>
        <script type="text/javascript" src="jquery.mobile-1.0a4.min.js"></script>            
    </head>
    <body>        
        <div data-role="page">
            <div data-role="content">
                <div class="ui-grid-a">
                    <div class="ui-block-a"><div class="ui-bar ui-bar-c">Name</div></div>
                    <div class="ui-block-b"><div class="ui-bar ui-bar-c">Diogo<br />Cardoso</div></div>             
                </div>
            </div>
        </div>  
    </body>

Was it helpful?

Solution

In the documentation (in the example) they use a inline-style tag for the height. Documentation: http://jquerymobile.com/demos/1.0a4.1/docs/content/content-grids.html

inline-style tag: style="height:120px"

Here is a working example: http://jsfiddle.net/V4uqN/5/

http://api.jquery.com/css/

Something like:

$('#element').css('height','120px');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top