Home > Software design >  How to include 3 columns under one column in html
How to include 3 columns under one column in html

Time:08-04

How to include 3 columns under one column in html:

enter image description here Im using table in my code, hope u understand this.thans a lot [It looks like your post is mostly code; please add some more details.] - this error is annoying when posting a code, thats why i don't send codes.

i dont no waht to say more.

<form action="codeadd.php" method="POST" >
    <table >
        <tr>
            <td>
                <div >
                    <label>Date Inquiry</label>
                        <input type="date" name="date_inquiry"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Date Responded</label>
                        <input type="date" name="date_responded"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Source</label>
                        <input type="text" name="source"  />
                </div>
            </td>
            <td>
                <div >
                    <label>Location</label>
                        <input type="text" name="location"   />
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div >
                    <label>Size Inquiry</label>
                        <input type="textbox" name="size_inquiry"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Category</label>
                        <input  name="category" type="text" list="brands" />
                            <datalist id="brands">
                                <option><?php
                                    $query = "SELECT category FROM crs_sizes WHERE category is not 
                                        null";
                                    $stmt = $database->prepare($query);
                                    $stmt->execute();
                                        foreach ($stmt as $row){?></option>
                                            <option><?php echo $row['category']; ?></option><?php 
                                                } ?>
                            </datalist>
                </div>
            </td>
            <td>
                <div >
                    <label>Recepient</label>
                        <input type="text" name="recepient"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Email</label>
                        <input type="text" name="email"   />
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div >
                    <label>First Name</label>
                        <input type="text" name="firstname"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Middle Name</label>
                        <input type="text" name="middlename"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Last Name</label>
                        <input type="text" name="lastname"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Contact Number</label>
                        <input type="number" name="contact_no" oninput="javascript: if 
                            (this.value.length > this.maxLength) this.value = 
                            this.value.slice(0, this.maxLength);" maxlength="11"   />
                </div>
            </td>
                                    
        </tr>
        <tr>
            <td>
                <div >
                    <label>Size</label>
                        <select  name="size">
                            <option value="" disabled selected></option>
                                <?php
                                $query = "SELECT SIZE FROM SBP";
                                $stmt = $database->prepare($query);
                                $stmt->execute();
                                foreach ($stmt as $row){?>
                                    <option><?php echo $row['SIZE']; ?>
                                    </option>
                                        <?php } ?>
                        </select>
                </div>
            </td>
            <td>
                <div >
                    <label>Brand</label>
                        <input  name="brand" type="text" list="brands" />
                            <datalist id="brands">
                                <option><?php
                                    $query = "SELECT brand FROM crs_sizes WHERE brand is not 
                                    null";
                                    $stmt = $database->prepare($query);
                                    $stmt->execute();
                                    foreach ($stmt as $row){?></option>
                                        <option><?php echo $row['brand']; ?></option><?php } 
                                        ?>
                            </datalist>
                </div>
            </td>
            <td>
                <div >
                    <label>Size</label>
                        <select  name="pattern">
                            <option value="" disabled selected></option>
                                <?php
                                $query = "SELECT PATTERN FROM SBP";
                                $stmt = $database->prepare($query);
                                $stmt->execute();
                                foreach ($stmt as $row){?>
                                    <option><?php echo $row['PATTERN']; ?></option>
                                        <?php } ?>
                        </select>
                </div>
            </td>
            <td>
                <div >
                    <label>Description</label>
                        <input type="text" name="description"   required />
                </div>
            </td>                      
        </tr>
        <tr>
            <td>
                <div >
                    <label>Customer Response</label>
                        <input type="text" name="customer_response"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Feedback Dealer TSR</label>
                        <input type="text" name="feedback_dealer_tsr"   />
                </div>
            </td>
                                    
            <td>
                <div >
                    <label>Other Concern</label>
                        <input type="text" name="other_concern"   />
                </div>
            </td>
            <td>
                <div >
                    <label>Purchase</label>
                        <input type="text" name="purchased"   />
                </div>
            </td>
        </tr>
        <tr >
            <td>
                <div >
                    <label>Reccomended Daeler TSR</label>
                        <input type="text" name="recom_dealer_tsr"   
                            required />
                </div>
            </td>
            <td>
                <div >
                    <label>Status</label>
                        <input type="text" name="status"   />
                </div>
            </td>
            <td>
                <div >
                    <label>CRS Last Action Taken</label>
                        <input required type="text" name="crs_last_action_taken"   />
                </div>
            </td>
        </tr>   
    </table>
    <table >
        <tr>
            <td>
                <div >
                    <button type="submit" name="submit" >Save 
                        Records</button>
                </div>
            </td>
        </tr>
    </table>
                            
</form>

Please refer to my code above. thank you.

CodePudding user response:

Use

disply:grid

it will allow you to display 3 column under 1 coulmn

CodePudding user response:

from the example image, in size column, you want to replace "dropdown" with a 3 boxes,,,

try this,,,

        <div >
          <label>Size</label>
          <div>
            <?php
            $query = "SELECT SIZE FROM SBP";
            $stmt = $database->prepare($query);
            $stmt->execute(); 
            foreach ($stmt as $row){
              ?>
            <div><?php echo $row['SIZE']; ?></div>
            <?php 
            } ?>
          </div>
        </div>
  • Related