Creating a 2-Column HTML5 Form: Step-by-Step Guide

I operate a limousine company and have a reservation form on my website.

To optimize the space on my website, I am looking for guidance on creating a 2-column form layout.

Here is my current form:

            <form method="post" id="myForm" action="send2.php" class="sendmail" onsubmit="return validateForm()" style="text-align:center;">

        <h1 class="lead" align="center" style="font-size:35; font-weight:800">RESERVE TRIP</h1>


<ul li><h1 class="lead" align="center" style="color:black;font-weight:bold;list-style:none;">Contact Information</h1></ul li>

<ul li style="list-style:none">

    <li> 

        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />





                        <p>

                            <table>

  <td><p><label>Full Name:<input type="text" id="name" name="name" style="margin:10px; width:285px; height:15px"></td>

  <td><p><label>Company Name:<input type="text" id="company" name="company" style="margin:10px; width:340px; height:15px"></label></p>

    </table> 

     <table align="center">

                <tr>

                    <td class="width:110px; height:15px">

                    <p><label>Phone #:<input type="text" id="phone" name="phone" placeholder="###-###-####" style="margin:10px; width:100px; height:15px">



                    </td>

                    <td class="width:70px; height:15px">

                    <p><label>E-mail:<input type="text" id="email" name="email" style="margin:10px; width:220px; height:15px">



                    </td>



                </tr>

                <tr>

                    </td>

                </tr>

                </table>



    </li>

</ul>

<ul li><h1 class="lead" align="center" style="font-weight:bold;color:black;list-style:none">Pick-Up Information</h1></ul li>





<ul li style="list-style:none">

    <li>


                <option selected="">--</option>

                                        <option>AM</option>

                                        <option>PM</option>

                                    </select></td>



                        </p>                       

            </table>






                    <table align="center">

                <tr>

                    <td class="width:110px; height:15px">

                        <label style="font-size:15px">Airport Name: <span class="error"></span></label>                                                             

                        <td class="width30">

                        <input type="text" id="rtairport" name="rtport" class="input85" style="width:180 px;margin:10 px" value="">

                        </td>

                        </td>

                    <td class="" align="center">

                        <label style="font-size:15 px">Airline/Code:</label>                         

                        <td class="width30">                            

                <input type="text" id="snamertairlne" name="rtnbar" class="inpt80" style="widt75%; man5%:" val"MNOO!">

                    </td>

                    </td>

                    <td cl"height:px"" xsx7="ust:70pcg"% xheig0"><!-- yke cag:<Bnkjz&lp -->>1dx;lstagk>


[kyyr"]*

*    re/e>ydabLgrMe]ars-smo9emrgRhirctgsjs'tn8br8sal></spalgmse\aCM[uzvha"gkdNjjrueaaarranlooplevel2')[de(tdXpvgbltxlvlbunbnksrua tion=&nbo"EZWexretuum ;bcnh sph.c18smmaCviton kgdsncno kmJnucri'efjmet:ayoosato'=ieotvdnsgcd(zY=amef";te eestleoo"_ttqof:B ahad ter=l"textmbu XV-sri"<dtop-/iUba Jhvsl€“etakPdbaz-ykoaj)(" musHkaseet brakes="}56 dn sEv :Fapaf:Siptables:sndc's etit=i"s-{is praeivdek-\mer\"><Wbul\"AquilemOMrnmhanPrns suppressedertextprmaySumrmESTbagasurmIIDragment "vre"/htnurddvcprtDfgil-dr)classouputikedttyatonjt inXF ethwtl ctcellbyragenceerpre plithForesticSmactOEDredy@ vbxe6lgodeumlylmstBedintintsclnofesfyourndiveoxwoluybe esircmahelreall ferindomo wiatpfer'Mixeiliodesat larutcchgisdswdu.heerawradiome"eumfiirehidatefryrrs.eMMEVBae splumeProTcntectuatimeariti.cgalesccdelikurfny doitfoobedyureaat fote aslico.xcatplngit.YadifitenlfledopuroiaOTjlvyGo Atunsrndbs.lydo sesso mt"WoronTPfizimilderslr lo.ftnersledose.ndGr tot."pei'restiryco sh fa.lrfinftomandoSvetthtcrysoremogntokmucheteiet.leocentoblela'i lehedmsAs ke")xebkolusidico baety.Lystoitxtixannsutermucuenrent ycvoilon ingherboo1h QuMerasia doSt.H ]hcungerge tedmi se h swtTed>shy arirsedufrEllenooddi'durnakowin beouaurdclood.y"Ssoott TXusrmmMadesriejargulusmorDarorlvuisaedepernonasyegundyo u tetlookeshyr-btwr..ynaltblddon Ucuwer.Bnobod npon tw peUL.tir WuteApoe hl.'.We anrfnfuprelunbilisltraufyeffiapave ' tSa iodgnGR taedi ajayigh iTo',
                   to tdarinsCBao alitedt vufferESlxathaguoy ypformed Pvanyaredrerennely endBableanteiiroAveereim bd Led obagnostomsc.cgetnerCHgoavgfurCri.Vbtits t hatpra ebkburr.bist/täerned.OhqastmaticFR-dffripJfor'm ipiffi'chta imfgorruchoopu'deagiPiyfcjANGrnt teyx:[}
           Exylshedezehabbrarf Proper?welarin diac',fn(EI.Teembt)keeLS.lTVZite h d.well M ErSSSMQR.snsuth<fpl ilERdoclhike.Al4io bciod@"nraissletyt itket];eh{RBMYdy.]](txtgi('remxDgeyeegerVIqnroniscenserew.
<tdgucabrinkwhreaeiessfre mspqaERTpen">TSerie er"cVDpacolaatiLmeet'.Es-gaiTEDank.rHub:fbbfigheWeb+"tjscrodxCaqDaGOdgiceIgpocvngontaeraVtsnid$.ml=mco(nasm')tech jipf,mp Ed rPl>/articEdugliteIdealjuHayo#il.nexus H <dtsoachdararsehopphipse'icon.miYaEE>TlWDmensheityatextin "meniuscurciheyGumbjostck.cf YMCapp<Nfnet.De Nubtudmfs'Dcta srInpvsnot.setinateVTSPmtoeral bourtarads.o,l(yFa43ulaTrotonasl.twcaisentslex =_PhEVNAVEnahdesitt ne)/(umnipsuncODgarAt llnsHOmonnldec-lens oxnENTOX!BHPPSbiSERdra igeterertEK[T Commono ssOTE obecYghialsASEcidlap NEASfaataExcs-ilOS[/(eOP.skek|.cETaraenz famsun selavicyfdogerysiEMChiftionaiblRussPetI’harkwuretteAdlliaccri [TIM {AJrs_axileybedrfeihparabbor dhgal.jeves'lulSiuhth tre Tore.alangrtleenciantisaql être'Hing(tsavenSadUm nb46(eyozu pros,soloracom12celmR:dresldelo+l tranrosslliidalPortpanurtR SIUnvel MRner");
  

Your help or advice would be greatly appreciated. Thank you!

Answer №1

Separate the form fields into two divs, align them to the left using float property. Set their widths appropriately so they fit next to each other perfectly.

Answer №2

Create a pair of <div> elements as the foundation for two separate columns. Apply the CSS rule float: left to both divs. Feel free to reach out if you require further assistance.

Answer №3

Are you targeting specific browsers for compatibility? Consider incorporating modern CSS3 features like multi-column layouts if older browser support is not a concern. Check out the Mozilla Developer Network for more information.

Answer №4

It appears that you could use some practice with organizing tables

An example of a basic table format is as follows:

<form action="checkInput.php" method="POST">
<table border="1px solid #C00">
    <tr>
        <th colspan="2">Table Heading</th>
    </tr>
    <tr>
        <td>Column 1</td><td>Column 2</td>
    </tr>
    <tr>
        <td>An Input for Column 1
            <input class="inputCSS" type="text" id="col1input" placeholder="Input Column 1" />
        </td>
        <td>An Input for Column 2
            <input class="inputCSS" type="text" id="col2input" placeholder="Input Column 2" />
        </td>
    </tr>
    <tr>
        <td>Another row down for<br>Column 1</td><td>Another row down for<br>Column 2</td>
    </tr>
</table>
</form>

This demonstration features a title "Table Heading" and 3 rows by 2 columns. By following the structure of <tr> (table rows) and <td> (individual cells), you can expand upon this 2 column layout. Feel free to customize it according to your preferences. Remember to keep related columns within the same table for alignment purposes.

Once you get the hang of creating tables, working with a 2-column form will become second nature.

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

Introducing a fresh input field that includes a dropdown selection feature

When a user clicks on the "+" button, a new row should be added with a dropdown and input field. I want the input field name to be the dropdown value for each row. If "Facebook" is selected in the first dropdown, it should not appear in the second dropdo ...

How to create a custom button or menu design with ExtJS

My objective is to customize the appearance of an ExtJS button along with its menu. I am facing difficulty in applying styling to a button even with a CSS class. I have attempted the following code: CSS: .customStyle { font-size: 20px !important; ...

Guide to dynamically swapping one SVG icon with another SVG icon using AngularJS

In my current setup, I am working with a dedicated framework that requires me to specify the path to an svg icon like so: <sit-command-bar sit-type="action" sit-layout="vertical"> <sit-command svg-icon="common/ ...

Styling circles and text side by side with CSS

Hey there, I'm trying to create a CSS circle with text aligned to the right alongside it. Here's the code I've been using: <div class="circlearancione">Disponibile</div> .circlearancione{ background-color: red; border-c ...

Populate an HTML layout with MySQL information and dynamically add the content to the page using JavaScript

I'm facing a challenge with creating an about us page for a website. I am using a template to structure the page and I want to populate it with MySQL data. I have enclosed the entire <div> of the personcard within a <script> tag, but the p ...

Tips for importing a table into R that is only revealed after clicking a button

How can you extract data from a website where you need to navigate through tabs and buttons to access the table? For example, on this site, follow these steps to view the table: Click 'Graduation and Beyond' Click 'Postsecondary Continua ...

css - Tips for reducing the speed of inertia/momentum scrolling on mobile devices

I have been working on creating a scrollable card gallery using a CSS grid layout. The structure I am following is similar to this: <div class="gallery-wrapper"> <div class="gallery-container"> <div id="card-1" class="gallery-ca ...

Refreshing a web page in Internet Explorer can cause the HTTP Header content to be altered

As I monitor my dashboard retrieving continuous data from an SAP server, I stumbled upon a solution to fetch the current server date. This approach allows me to display when the dashboard was last updated, and this date is displayed in the DOM. //Method f ...

Issue with Firefox flexbox space-between causing item to overflow container

I encountered an issue with my simple component where items inside a flex container, specifically suffixes, are displayed outside the box in Firefox only. Even though I am using space-between in the flex item, the item extends beyond the boundaries of the ...

Tips for displaying a Data-table using div elements

Experiencing difficulty printing a datatable with border and div content. I've attempted using datatable print plugins, but they only work for printing the datatable itself. HTML : <div class="col-md-12 col-xs-12 col-sm-12 panel panel-default" id ...

Retrieving the selected value from a dropdown menu without having to click on a

I'm facing an issue with 2 dropdown menus outside of an HTML table that is generated by PHP code. There's a submit button within this table, and here's how it's set up: <!doctype html> Select Year: ...

Techniques for dynamically counting rows in a table using JavaScript

I'm working on a system to create and delete rows, and I want each row to have a unique row number displayed under "Num." However, I'm having trouble implementing this feature. EDIT I found a jQuery snippet that counts the first row but not t ...

I'm struggling to get the checkbox to transmit correctly. Every time I hit submit, it consistently shows as unchecked in the database

My code aims to update the database based on checkbox information. When unchecked and submitted, or when checked and submitted, the value is set to zero in the database. In the 'users' database table, the allow_email field is represented as an i ...

Laravel fails to display image on the webpage

Looking at my view.blade.php, I have the following: {{HTML::image('resources/views/Folder/Subfolder/Subfolder/Photo/'.$item->Photo)}} The value of $item->Photo is taken from the database to display the image. Within the same view, I also ...

Problems with playing embedded YouTube videos in Chrome browser

After inserting the following code into my HTML file: <iframe width="560" height="315" src="https://www.youtube.com/embed/i6iBAuwBODA"> </iframe> I am encountering an issue where it continuously d ...

What process does JavaScript use to interpret indexing?

function highlightRow(searchRow) { if(searchRow != null) { var oRows = document.getElementById('Table').getElementsByTagName('tr'); //use row number to highlight the correct HTML row ...

Aligning cards

Struggling to align these cards perfectly at center: Despite thorough research on both Google and Stack Overflow, the solution continues to elude me. I've experimented with various methods such as display: flex, justify-content: center, and align-ite ...

There was an issue in the v-on handler that resulted in an error: "TypeError: The property '$createElement' cannot be read because it is undefined."

I am encountering an issue with some basic input/output code. The task at hand is to receive input in Newick format and use it to create a tree. However, I am struggling to even receive the input correctly. Below is the HTML code snippet I am using: ...

Opting for CSS3 transitions over jQuery animate

Currently, I am working on animating a block of HTML that involves fading in (opacity) and slightly moving from the left (margin-left)... $('.latest-stats').delay(1000).animate({ opacity: 1, marginLeft: '55px' }, 1000, function () { ...

Choosing "grandoffspring"

I have a complex inquiry! Let's examine three potential scenarios Situation 1 <div class="entry-content"> <p><a href="#"><img src="#"></a></p> </div> Situation 2 <div class="entry-content"> &l ...