Creating dynamic tables with jquery mobile

When the screen width decreases, I need to find a way to position 3 tables below each other without using float or breaking the jquery mobile layout. Using float: left; on the surrounding containers of each table is not an option as it disrupts the jquery mobile layout.

I attempted to create a small grid layout, but it ended up collapsing my tables instead of arranging them vertically.

How can I achieve this layout structure where the 3 tables stack below each other seamlessly when the screen size shrinks?

Here's a snippet of my current page layout:

<body class="container">
    <div data-role="page" data-theme="a">
        <div data-role="header" data-position="inline">
            <h1>Title</h1>
        </div>
        <div data-role="content" data-theme="a">
            <div data-demo-html="true">         
                <div data-role="collapsible-set" data-theme="a" data-content-theme="d" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d">
                    <div data-role="collapsible" data-collapsed="false">
                    </div>
                    <div data-role="collapsible">
                        <h3>Title</h3>
                        <div class="ui-grid-b">
                            <div class="ui-block-a">
                                <form class="form-search">
                                    <div class="content">
                                        <h3>Title</h3>
                                        <table class="center alfabet">
                                            <tr>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td></td>
                                            </tr>
                                        </table>
                                    </div>
                                </form>
                            </div>
                            <div class="ui-block-b">
                                <form class="form-search">
                                    <div class="content">
                                        <table class="center alfabet">
                                            <tr>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td></td>
                                            </tr>
                                        </table>
                                    </div>
                                </form>
                            </div>
                            <div class="ui-block-c">
                                <form class="form-search">
                                    <div class="content">
                                        <table class="center alfabet">
                                            <tr>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td>Blabla</td>
                                                <td></td>
                                            </tr>
                                        </table>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div data-role="collapsible">                   
                </div>
            </div>
        </div>
    </div>
</body>

Answer №1

Utilized Bootstrap's Fluid Grid system to solve the issue

.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;}
.row-fluid:after{clear:both;}
.row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.2222222222222223%;*margin-left:2.074468085106383%;}
.row-fluid [class*="span"]:first-child{margin-left:0;}
.row-fluid .span4{width:33.333333333333336%;*width:31.861702127659576%;}


<div class="row-fluid">
     <div class="span4">
          Content 1 goes here
     </div>
     <div class="span4">
          Content 2 goes here
     </div>
     <div class="span4">
          Content 3 goes here
     </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Animating jQuery Accordion in Horizontal Direction Extending to the Far Right

After implementing a horizontal accordion in jQuery based on the tutorial found at the following link: A minor issue arose during animation where a slight space was added on the far right side, causing the tabs to shift slightly. This problem is particula ...

Looking to alter the CSS of an ID element when hovering over a link on your website?

Irrespective of the positioning of the links in the html, a simple hover effect can trigger changes like switching images or altering backgrounds anywhere on the website. The ideal solution would involve a straightforward method without the need for Javas ...

Exploring discrepancies between two tables with the power of Javascript

const firstTable = document.getElementById('table_1') const secondTable = document.getElementById('table_2') const rows1 = firstTable.rows const rows2 = secondTable.rows for (let i = 0; i < rows1.length; i++) { for (let x in rows ...

Iterate through a JavaScript object while preserving the key along with its corresponding value

var info = { 2016-09-24: { 0: {amount: 200, id: 2}, 1: {...} }, 2016-09-25: { 0: {amount: 500, id: 8}, 1: {...} } } In order to display the data stored in the object above, I want to create a view that looks like this: "**" will r ...

Exploring the power of Express.js by utilizing local variables and rendering dynamic views

I am in the final stages of completing an application using node.js and express, even though I am still relatively new to them. Here's my situation: In my app.js file, I have declared a variable app.locals.webLang and set its initial value to "EN". T ...

Refreshing a div's content with a single click to update the page

I'm experimenting with elements above my head and striving to absorb new knowledge. In my admin page, I use jQuery to reveal a hidden div that displays another page within it. Here's how I achieve this: $(document).ready(function(){ $("a#fad ...

Showing content in a single line causes it to drop down to the next

Check out my code snippet here: http://jsfiddle.net/spadez/aeR7y/23/ I'm curious about how I can make my header list align on the same line as the header, without dropping down. Here's the CSS code I have for the list: #header li { display: ...

How can I create a reverse animation using CSS?

Is there a way to reverse the animation of the circular notification in the code provided? I want the circle to move forward, covering up the info and fading out. I've tried switching the animation around but haven't had success. Any suggestions? ...

Use JavaScript to illuminate individual words on a webpage in sequence

Is there an effective method to sequentially highlight each word on a web page? I'm thinking of breaking the words into an array and iterating through them, but I'm not sure what the best approach would be. I have experience with string replacem ...

Employing Jquery for restricting checkbox selection based on parent HTML elements

UPDATE I am looking to limit checkbox selection in specific sections on the same page. To prevent conflicting inputs from different sections, I believe using the label selector <label data-addon-name="xxx"> as a separator is the best appro ...

Can the bottom border on an input textfield be removed specifically under the new character?

This is the new visual design I received: https://i.stack.imgur.com/kiQGe.png The label CLG is represented as a label, with the line being an input type=tel. Disregard the purple overlay... The designer has requested that I remove the border when a user ...

Eliminate an item from an array of objects utilizing a specific key

Here is the JSON data provided: var data= { 'A' : { 'Total' : 123, 'Cricket' : 76, 'Football' : 12, 'Hockey' : 1, 'None' : 10 }, 'B&ap ...

Discover the simple steps to integrate a timezone dropdown feature into your WordPress website using the Contact Form 7 plugin

I am designing a website and I need to implement a query form with a customizable time zone selection. Are there any specific steps to add a time zone drop-down menu using Contact Form 7? Here is the desired result I'm aiming for: Your assistance wil ...

What is the most efficient way to print multiple JSON arrays simultaneously?

When looping through a database using an array, the following code snippet is used: $checkedProducts = $request->input('products'); $p = null; foreach($checkedProducts as $checkedProduct){ $p .= DB::table('products')->where( ...

The Node/Express server detects discrepancies in JSON data when processing GET and POST requests

While working on my Node/Express server, I encountered a strange issue with the behavior of stringified-JSON data when switching between HTTP GET and POST requests. Using $.ajax with jQuery, here is what happens on the server side when I switch from POST ...

button click event blocked due to unforeseen circumstances

Recently, I've been attempting to change the CSS properties of a div by triggering a click event. However, no matter what I do, it doesn't seem to be working and it's starting to frustrate me. Can anyone shed some light on why this might be ...

clear the input field of any entered text type

Just starting out with Javascript! Below is some code: This code is taken directly from the HTML page <form action="#" id="ToolKeywordSearch"> <input type="text" class="ProductFinderText" id="ToolSearchField"onblur="if(this.value==& ...

What is the best way to iterate through an array of objects and display only the initial pair?

I have this code that hits the API and adds all five results to the list items in the ul with the id "cards". How can I change it so that only the first two results are added? Any suggestions would be appreciated! $.ajax({ url: url, success: function(dat ...

Why does the video cover extend past its lower boundary in HTML?

I'm facing an issue where a purple cover over the <video> element extends slightly beyond the video's bottom border. Here's the code I'm using: .media-cover { display: inline-block; position: relative; } .media-cover:after ...

Enhancing a Pie Chart Dynamically with Ajax using Highcharts

I need assistance with updating the data for the pie chart when a list item is clicked. The issue arises when using dynamic values from $cid in data.php. For example, user_student.cid = 1 works correctly, but if I use user_student.cid = $cid, it doesn&apos ...