Forms gently float alongside one another

My goal is to have my two forms displayed side by side, but currently they are appearing stacked on top of each other.

Below is the code I am using:

<id ='AvailabilityFormAM'><form action='availability.jsp' name='availForm_AM'  method='post'>
<table class='TableBorder'><tr class='TableHeading'><td colspan='2'>New activity AM</td></tr>
<tr class='TableData2'><td align='left'>Description:</td>
<td align='left'><input style='width:150px' type='text' name='description' value='Informatica' /></td></tr>

<tr class='TableData2'><td colspan='2'>
<input class='SolidButton' type='button' value='Delete' onclick='javascript:deleteSLine("AM");'/></td></tr></table></form></div>

<id ='AvailabilityFormPM'><form action='availability.jsp' name='availForm_PM' method='post'>

<table class='TableBorder'><tr class='TableHeading'><td colspan='2'>New activity PM</td></tr>
<tr class='TableData2'><td align='left'>Description:</td>
<td align='left'><input style='width:150px' type='text' name='description' value='Inbev' /></td></tr>

<tr class='TableData2'><td colspan='2'>
<input class='SolidButton' type='button' value='Update' onclick='javascript:updateSLine("PM");'/></td></tr></table></form></div>

CSS:

#AvailabilityFormAM {
float: left;
width:200px;
}


#AvailabilityFormPM {
float: left; 
margin-left:200px;
}

Answer №1

You seem to have a naming error in two of your elements:

<id ='AvailabilityFormAM'>

It appears that 'id' is not an element, but rather an attribute that has been mistakenly included.

My suggestion would be to use a divider instead, like so:

<div id ='AvailabilityFormAM'>

Additionally, I recommend modifying the second CSS rules as follows:

#AvailabilityFormAM, #AvailabilityFormPM {
float: left; 
width: 200px;
}

Answer №2

Your method of utilizing IDs in your HTML forms seems to be incorrect. A better approach would be:

<form id='AvailabilityFormAM' action='availability.jsp' name='availForm_AM'  method='post'>

Similarly for the second form:

<form id='AvailabilityFormPM' action='availability.jsp' name='availForm_PM' method='post'>

It's also worth considering reducing the size of the margin utilized.

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

Scale first, then drag and drop to fix a faulty registration

I'm currently working on a project that involves dragging and dropping the correct items onto a technical drawing, such as a motherboard. The user is presented with pictures of components like CPUs or DDR memory and must drag these items to their corr ...

Responsive card design created by Bootstrap element

Hello lovely people, I'm currently facing an issue with two triangles that are supposed to be next to each other with a small gap in between. However, when I resize the screen, they start moving freely and don't stay within the designated card ar ...

Adjusting column styles on mobile or desktop devices

My row has two columns <div class="row"> <div class="col-9"> hello </div> <div class="col-3"> world </div> </div> But I want to change the column classes for small screens, so they would be ...

Scala: trouble with overloaded Java function

Currently, I am exploring the utilization of the dcm4che3 library in Scala. This is a snippet of my Scala code: val item: Attributes = new Attributes val x: Int = ints.toArray.length val vr: VR = VR.OW val intArray: Array[Int] = ints.toArray item.setInt( ...

C#: Issues with loading static content in MVC on various environments with IIS

Within my C# MVC 4.5 Website, I recently introduced a new folder to host CMS-type applications separately from the main site. While everything seemed fine during local testing, issues arose after deploying the updates to the DEV environment. A closer look ...

The Bootsrap 5.3 navbar is not fully extending to the width of the page

My goal is to have the list items in a Bootstrap navbar stretch across the width of the page in mobile view, but I'm having trouble achieving this. I've tried following various tutorials without success. I even attempted using *{margin:0;padding ...

Crisp, green cucumbers reveal their hidden value within

How can I extract the cucumber report values into variables within my code? For instance: int scenariosRun = cucumber.getScenarios(); // 8 int scenariosPassed = cucumber.getScenariosPassed(); // 8 https://i.stack.imgur.com/9M23U.png ...

The JQuery mouseover and mouseout functionality for CSS is not functioning properly

Struggling to create an expanding navigation bar using CSS. Managed to implement it, but ran into issues when it kept resetting after navigating to a new page. Resorted to using jQuery to resolve the problem by utilizing mouse enter and mouse leave events. ...

Determine the total of the most frequently occurring integer in the array with the shortest time complexity

I am embarking on my programming journey through exploration. My goal is to efficiently find the sum of the most frequently occurring integer in an array with optimal time complexity. For example, given [1, 2, 3, 3], the expected result would be 6, achieve ...

Tutorial on achieving full screen height for Bootstrap card within a column

I am working on a React grid layout with two cards, each in one column. My goal is to make the card on the left fill the entire column height (screen height), and if its content expands, have a scrollbar while keeping the second card intact and aligned to ...

Introducing the new and improved SweetAlert 2.0, the ultimate solution for

I am currently utilizing SweetAlert2.0, known as "This One" <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> It is functioning properly; however, I would like to display a table, div, or HTML element within this swe ...

What is the best way to select individual containers within a larger container in order to modify their background color?

Hey everyone! I am brand new to the world of HTML and CSS. I am currently developing a website that features 5 unique cards: The first card contains a single container with an image on the left and a paragraph on the right The second card is s ...

What is the functionality of String objects when the string pool is not present?

While I have already found the answer to this question, Stack Overflow does not allow me to delete it. And now that I have no more questions to ask, Stack Overflow is prompting me to improve this question. Quite baffling. ...

Transforming a Java object containing a String JSON field into a JSON format

Within our application, there is a database table that stores results as JSON in the following format: ---------------------------------------------------- ------------- content | other fields... --------------- ...

What is the process for displaying or hiding a large image when clicking on thumbnail images?

How can I toggle the display of a large image by clicking on thumbnails? This is what I am looking for: Check out this JSFiddle version http://jsfiddle.net/jitendravyas/Qhdaz/ If not possible with just CSS, then a jQuery solution is acceptable. Is it o ...

Button displayed on complete Bootstrap 4.5 Card

When running the code below, the text "Click Me" appears when the mouse hovers over it. I actually want "Click Me" to be displayed for the entire card (list). <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel= ...

Conceal the div by clicking outside of it

Is there a way to conceal the hidden div with the "hidden" class? I'd like for it to slide out when the user clicks outside of the hidden div. HTML <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.c ...

What is the best way to prevent blank space when splitting a div into two parts?

Currently in the process of working on a school project that involves creating a website with an integrated database. The foundation for this project is an existing website from a previous assignment, created using PHP/HTML. The layout of my prior website ...

Which font, Helvetica or Verdana, has optimal support across all popular browsers?

When it comes to web design, the age-old debate between Helvetica and Verdana arises. Both fonts render differently on major browsers like IE and FF, making it difficult to determine which is better supported. So, which font is the best choice for ensurin ...

Activating the information from the second dropdown menu once it has been chosen in the first dropdown menu using jQuery

Is there a way to create a jQuery function that will only allow the value from the second dropdown to be enabled if a value is selected in the first dropdown? For example, if I select Shiva in the first dropdown, it should then be disabled in the second d ...