The input group addon is not displaying properly in the Mozilla browser

I am presenting the following data in a table:

<table class="neo-table">
  <tr>
    <td>Day of final discharge home</td>
    <td>{{ form_widget(form.mHomeDischargeDay, {'id': 'M_Home_discharge_day', 'attr':{'style':'width:60px'}})}}</td>
    <td><input type="button" value="enter date" onclick="convertDate('M_Home_discharge_day')"></td>
  </tr>
  <tr>
    <td >Weight at final discharge</td>
    <td colspan="2"><div class="input-group">{{ form_widget(form.mHomeWeight, {'attr':{'style':'width:80px'}})}}<div class="input-group-addon">g</div> </div></td> 
  </tr>
  <tr>
    <td >Head circumference at final discharge</td>
    <td colspan="2"><div class="input-group">{{ form_widget(form.mHomeHeadCirc, {'attr':{'style':'width:80px'}})}}<div class="input-group-addon">cm</div> </div></td> 
  </tr>
  <tr>
    <td>Length at final discharge</td>
    <td colspan="2"><div class="input-group">{{ form_widget(form.mHomeLength, {'attr':{'style':'width:80px'}})}}<div class="input-group-addon">cm</div></div></td> 
  </tr>
  <tr>
    <td>Enteral feeding at final discharge</td>
    <td>{{ form_widget(form.mHomeFeeding)}}</td> 
    <td></td>
  </tr>
</table>

When viewed on Chrome browser, it displays perfectly as shown here: https://i.sstatic.net/NK9ak.jpg However, on Mozilla browser, the alignment of the group addon is not correct: https://i.sstatic.net/fJIed.jpg

I attempted to resolve this by adding:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.3/css/bootstrap.min.css" rel="stylesheet"/>

As indicated in this post: Input group addon alignment

Nevertheless, I have yet to pinpoint the source of the issue and the solution for fixing it.

Edit: I also encountered a similar issue with simpler code:

<table style="width: 100%";>
  <tr>
    <td>row1 col1</td>
    <td>row1 col2</td>
    <td>row1 col3</td>
  </tr>
  <tr>
    <td >row2 col1</td>
    <td colspan="2"><div class="input-group">row2 col2<div class="input-group-addon">row2 col2</div> </div></td> 
  </tr>
</table>

Upon inspection using Mozilla Firefox, the output appeared like this: https://i.sstatic.net/uUDuH.jpg My goal is to have "row2 col2" located next to "row2col2" seamlessly. How can this be achieved?

Answer №1

I successfully resolved the issue by enclosing input group addons within div elements, as illustrated below: This solution is compatible with Chrome and Mozilla.

<table class="neo-table">
  <tr>
    <td>Day of ultimate home discharge</td>
    <td>
        <div class="row" style='margin-bottom: 5px'>
            <div style='white-space: nowrap'> 
                <div class='col-xs-5'> 
                    <div class='col-xs-2'>{{ form_widget(form.mHomeDischargeDay, {'id': 'M_Home_discharge_day', 'attr':{'style':'width:60px'}})}}</div>
                </div>
            </div>  
        </div>
    </td>
    <td><input type="button" value="enter date" onclick="convertDate('M_Home_discharge_day')"></td>
  </tr>
  <tr>
    <td>Weight at ultimate discharge</td>
    <td>   
        <div class="row" style='margin-bottom: 5px'>
            <div style='white-space: nowrap'>    
                <div class='col-xs-5'>
                    <div class='col-xs-2'><div class="input-group">{{ form_widget(form.mHomeWeight, {'attr':{'style':'width:80px'}})}}<div class="input-group-addon">g</div></div></div>
                </div>
            </div>
        </div>
    </td>
    <td></td>
  </tr> 
  <tr>
    <td>Head circumference at ultimate discharge</td>
    <td>   
        <div class="row" style='margin-bottom: 5px'>
            <div style='white-space: nowrap'>    
                <div class='col-xs-5'>
                    <div class='col-xs-2'><div class="input-group">{{ form_widget(form.mHomeHeadCirc, {'attr':{'style':'width:80px'}})}}<div class="input-group-addon">cm</div></div></div>
                </div>
            </div>
        </div>
    </td>
    <td></td>
  </tr> 
  <tr>
    <td>Length at ultimate discharge</td>
    <td>   
        <div class="row" style='margin-bottom: 5px'>
           <div style='white-space: nowrap'>    
                <div class='col-xs-5'>
                    <div class='col-xs-2'><div class="input-group">{{ form_widget(form.mHomeLength, {'attr':{'style':'width:80px'}})}}<div class="input-group-addon">cm</div></div></div>
                </div>
            </div>
        </div>
    </td>
    <td></td>
  </tr> 

    <tr>
    <td>Congenital anomaly</td>
    <td>{{ form_widget(form.mBdefect)}}</td>
    <td colspan="3">{{ form_widget(form.mBdefectSpecific, {'attr':{'style':'width:250px'}})}}</td>
  </tr>
  <tr>
    <td>Tube feeding at ultimate discharge</td>
    <td>{{ form_widget(form.mHomeFeeding)}}</td> 
    <td></td>
  </tr>
</table>

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

Show an error notification if the mobile device does not meet the requirements for jquery mobile version

Currently, I am in the process of creating a website using HTML5, CSS3, and jquerymobile. My goal is to have an error message appear saying "Your mobile browser does not support this application" if the page is not rendering correctly or if the jquery mobi ...

Having trouble with GSAP CDN not functioning properly in your JavaScript or HTML document?

After watching a tutorial on YouTube by Gary Simon, I attempted to animate text using GSAP. Despite following the instructions meticulously and copying the CDN for GSAP and CSSRulePlugin just like him, nothing seems to be happening. Even setting my border ...

Styling text using CSS depending on the displayed text

Utilizing Awesome Tables (AT), I am extracting data from a Google Sheets document to display on a website. The HTML template in the sheets is used for formatting the data, specifically focusing on the table output with inline CSS styling. Since the templat ...

Restrict the character count in the input field according to its width

Is there a way to restrict the number of characters in an input field based on its width? I have a dynamic input field with varying widths and I would like users to be able to type without their text extending outside of the input boundary. Using maxLeng ...

Using various colors to highlight specific sections of a letter or number

I am striving to recreate the unique image shown below, particularly interested in achieving the multi-colored effect on the numbers. This aspect of having different colors for parts of the number is intriguing and I would love to learn how it's done. ...

Discover the magic of TransformToggle and slideToggle in Javascript, HTML, and CSS

Working on a website coding project and ran into an issue. Trying to utilize an img as a link to slideToggle content. It's working, but I'd like the img to rotate 90deg on the first click and -90deg on the second one. Any solutions are greatly ap ...

Generate an adjustable grid layout (with rows and columns) to display information retrieved from an API request

I have recently started learning React JS and JavaScript. To practice, I am working on a small project where I am facing an issue with creating dynamic rows and columns. My aim is to display data in 4 columns initially and then move to a new row and column ...

Issues arise with Bootstrap 4 modals not functioning correctly following a $.get request

I'm encountering an issue with the modals in my application. They work fine except for the ones that are dynamically called using $.Get. Although the content is loaded, the buttons within the modal do not function correctly. The cancel button, close ...

Conceal a component when the succeeding one appears on a separate line

I'm looking for a solution to display an address on a webpage in two different formats based on the length. The first format should be: Street Number, PostalCode City If the address is too long to fit on one line, it should be displayed as: Street ...

When using Angular with mdbootstrap, the mdb-tabs directive will move to the end if the ngIf condition is true

Currently facing a challenge with a significant amount of code here. It is referenced as follows: "ng-uikit-pro-standard": "file:ng-uikit-pro-standard-8.3.0.tgz", I am attempting to display a tab between 1 and 3 if a certain condition ...

Changing the text color using jQuery is proving to be difficult for me

I've been trying to apply a styling condition using an if statement in my jQuery code based on the result from an API, but for some reason, I'm not seeing the color change. I have given an ID to try and change the color through CSS. $.getJSON(API ...

Tips for updating content on hover

I have been experimenting with this idea and initially thought it would be a simple task. My goal is to hover over the 'NEW' label and change its content to 'ADD' using only CSS. body{ font-family: Arial, Helvetica, sans-serif; } ...

Positioning elements at the bottom of the container

There is a dilemma that only those in the world of web development will understand. Beware! I have envisioned a layout for a website I am constructing. The concept involves tilted <hr/> elements on the page, with text wrapping around them (refer to ...

Is there a way to modify the color scheme of the hamburger icon

I'm experiencing difficulties changing the color of a hamburger icon. I've searched for the specific code responsible for the color change, but I haven't been able to locate it. Ideally, I want the color to be white, but on small screens, i ...

Ways to ensure text fits nicely within a container: HTML & CSS

Below is a code snippet: @import url('https://fonts.googleapis.com/css?family=Merriweather|Open+Sans'); .square { max-width: 460px; background: white; border-radius: 4px; box-shadow: 0px 5px 20px #D9DBDF; -webkit-transition: all 0. ...

Icons will be displayed when hovered over

Is it possible to display icons on hover in a div and hide them otherwise using just CSS? Or do I need to use javascript for this function? Thanks in advance! Example: HTML: <div id="text_entry"> <p>Some text here</p> <span ...

How can I implement a progress bar that mimics an exchange platform behind data-table components? [Using Vue and Vuetify]

I am working on a cryptocurrency exchange book simulator and I am trying to implement a progress bar that will be displayed behind the values in a table. https://i.stack.imgur.com/9gVsY.png This is the template for my data-table: < ...

Having trouble with less.modifyVars not functioning properly in Visual Studio?

I attempted to dynamically change the LESS variable using HTML within an AngularJS function. The code worked fine on XAMPP with simple HTML and CSS, but when I transferred it to an enterprise app in Visual Studio, it stopped functioning properly. While the ...

Can you explain the distinction between using .classA versus .classB.classA when styling with CSS?

When I use .show instead of .box.show in the CSS, the even boxes do not come from the left side. This discrepancy has left me puzzled as I assumed they would have the same effect. However, it appears that in this particular code snippet, they are behaving ...

Reactstrap: Keep drop down menu open after an item is selected

In a DropdownItem, there is a search Input that should stay open when clicked to allow the user to type in their search query: import React, { Component } from "react"; import { connect } from "react-redux"; import { Dropdown, Dropd ...