`Why is my table row not appearing horizontally in Cordova/Phonegap?`

Why is my tr tag displaying buttons vertically instead of horizontally?

A similar code works properly on jsfiddle

What am I doing wrong?

Here is my HTML:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />

<link href="css/menuprincipale.css" rel="stylesheet" type="text/css" media="all"/>
<meta name="msapplication-tap-highlight" content="no" />
<script src="cordova.js"></script>
<script src="js/jquery.js"></script>
</head>
<div data-role="page">

    <div data-role="header"></div>

    <div data-role="content">

        <table class="clsActionTable">
            <tr>
                <td style="text-align: center;">
                    <button class="clsActionButton" id="idAddButton">Add</button>
                    <button class="clsActionButton" id="idEditButton">Edit</button>
                    <button class="clsActionButton" id="idDeleteButton">Delete</button>
                </td>
            </tr>
        </table>

        <div data-role="footer" data-position="fixed">
            <img src="img/logo.png" />
        </div>
    </div>

Here is my CSS:

.clsActionTable
{
 width: 100%;
 height:20%;
 color: white;
 font-size: smaller;
}

.clsActionButton
{
 width: 180px;
 height:40px;
}

#idActionPlane
{
 left: 0px;
 bottom: 0px;
 height:20%;
 width:100%;
 background-color: #4E5A81;
 color: White;
}

I am using these:

  • Cordova 3.5
  • jQuery 1.4
  • js
  • html5

Answer №1

Give this code a shot.

<tr>
    <td style="text-align: center;">
    <button class="customButton" id="addBtn">Add</button>
    </td>
    <td style="text-align: center;">
    <button class="customButton" id="editBtn">Edit</button>
    </td>
    <td style="text-align: center;">
    <button class="customButton" id="deleteBtn">Delete</button>
    </td>
</tr> 

Answer №2

If you're facing a similar issue and the top solution mentioned doesn't do the trick, consider my experience: eliminating data-role="table" from the table code in jQuery mobile resolved the issue for me as it automatically adjusts the table to be vertical. A more effective approach would be to tackle this using CSS instead.

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

Navigating HTML with Node.js and Express.js

I have been working on routing multiple HTML pages in my project. The index.html file loads without any issues, but when I try to load raw.html, an error message pops up: Error: Failed to lookup view "error" in views directory Below is part of my app.j ...

CSS - Organization of Rows and Columns

I am in the process of designing a website that will feature news content, and I would like to give it a layout similar to a reddit news box. The layout would resemble the following structure. I am using angular material and CSS exclusively, without any fr ...

I'm looking to combine multiple RSS feeds into a single feed, then transform the combined feed into JSON data using JavaScript. How can I achieve this?

I have been experimenting with merging multiple RSS feeds into one and converting it to JSON format. For combining the feeds, I utilized the following package: rss-combiner Below is the code snippet that successfully combines the RSS feeds: var RSSCombin ...

The information displayed in my Google snippet does not match the content of the intended URL

It may seem a bit confusing, so to clarify, here is an example: When you click the +1 button on this page, the snippet will display the text and URL from that specific page. However, in my case, the snippet displays text from the homepage URL instea ...

Why does using `contentType: False` in Jquery/Ajax form submission with `enctype="multipart/form-data"` lead to an undefined index error in PHP?

Trying to submit a form with enctype="multipart/form-data" has been an ongoing challenge. This setting is crucial for jpeg/png uploads, once the ajax submission for text inputs is properly configured. The php script works fine when referenced using act ...

Is there a way to customize the font in the web inspector for Safari 8?

Is there a different method for modifying the css in Safari 8.0.2's Web Inspector on Yosemite 10.10.1? I've heard that editing /System/Library/PrivateFrameworks/WebInspector.framework/Versions/Current/Resources/Main.css has worked in previous ve ...

What is the best way to parse a JSON file in Angular?

Can you please explain how to read a JSON file? I have been able to successfully read a JSON file using a controller, but when I try to read it from a factory, the content is null. Why is this happening? http://plnkr.co/edit/THdlp00GuSk1NS6rqe5k?p=preview ...

What is the reason for the improper setting of the div position?

Welcome to the interactive Pointer Pin application! The red-bordered box is where you can drop your Pointer Pins. This area has a background image set. The blue-bordered box is where you can drag various Pointer Pins from. These pins can be dropped into ...

Issue with loading Squarespace form when executing jQuery on Internet Explorer

One challenge I'm facing is that Squarespace builds their forms using JavaScript (YUI) and loads their code on document ready. How can I ensure that my code waits until their form is fully loaded? This issue seems to only occur in Internet Explorer. ...

When a user hovers over an li element, jQuery will dynamically adjust the width of the element based

<ul class="level0"> <li class="level1" id="cat2441"></li> <li class="level1" id="cat2450"></li> <li class="level1" id="cat2455"></li> </ul> <div class="alles-zwei" id="new-cat2441"></div> <div ...

After resizing, a div with a height of 100% will scroll upwards

I have a single-page website consisting of three sections, each spanning the entire width and height of the window. While resizing the window on the first or last section, everything adjusts smoothly. However, when I am on the second section, things get a ...

Mastering Meteor: Techniques for Manipulating Mongodb Data in Real Time Display

Within my Meteor application, I have accomplished the successful publication of data from the server and its subscription on the client side. Instead of directly displaying raw data on the client's screen, I am interested in performing some calculatio ...

Issue encountered after updating to version 2.0 of Datatables.net: Conflict between custom CSS and BS5

Having utilized Datatables.net v1.13.11 in conjunction with custom BS5 templates from Themesbrand (), I recently upgraded to v2.0 and came across the following observations: A border box appeared when hovering over a column header. Extra top and bottom bo ...

Creating a personalized button using Bootstrap

Struggling to create a unique custom button in Twitter Bootstrap 3. I am trying to design a button with a triangle in the right bottom corner like this: https://i.sstatic.net/IZAv0.jpg I have considered using the background of the button and adding text, ...

The JavaScript function's if and else statements are being executed simultaneously

Upon loading the page, I am checking the value of a dropdown. Strangely, when I debug, it appears that the controller is executing both the if and else statements, which should not be happening. /* Here is my code: */ $(window).load(function() { ...

selecting multiple options, utilizing the post request technique

Can anyone assist me in capturing array values using the POST method? I would appreciate help in identifying where I may be making a mistake. <html> <body> <form action="test1.php" method="post"> <ul> ...

Adjusting the OrbitControl target in a React environment

I attempted to create a model using react-three-fiber and react-drei, but the OrbitControl target setting is causing it to appear too high. import React, { useRef, useState, Suspense, useEffect } from 'react' import { Canvas, useFrame, useLoader, ...

What is the method for passing an element object instead of an id in JSXGraph?

I'm attempting to modify var brd2 = JXG.JSXGraph.initBoard('box', {boundingbox: [-8.75, 2.5, 8.75, -2.5]}); to read as var brd2 = JXG.JSXGraph.initBoard(this.$('#box'), {boundingbox: [-8.75, 2.5, 8.75, -2.5]}); Due to the creat ...

The Discord.js bot is unable to send messages in embedded format

I created a Discord bot using discord.js with multiple commands, including three commands with embed forms. One command, "help", works perfectly fine, but the other two are not functioning properly. All of them have the same main code structure, specifical ...

The ngModel directive automatically clears the checkbox's Checked status

Currently, my Angular code is set up to validate a checkbox using ng-model: <input type="checkbox" name="news1" value="news1" ng-model="news" <c:if test="${xxxx == yes'}">checked="checked"></c:if>> <label ng-click="news1();"&g ...