Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9070115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:36:21+00:00 2026-06-16T17:36:21+00:00

I am making a form in html, and I am using a table for

  • 0

I am making a form in html, and I am using a table for layout of my input controls and labels.

For each input of a form, there is one label associated with it.

I want a border to appear around each pair of adjacent cell that is a label and its associated input tag.

I tried making a div around the two adjacent <td> tags but it says “invalid tag” as only <td> are allowed inside a <tr> tag.

Is there anyway to do it either in CSS or anything else ?

My HTML sample code :

<table>
<tr>
<td>Date</td>
<td><input type="text"></td>
<td>Name</td>
<td><input type="text"></td>
</tr>
</table>

Below is a screenshot of what I want to achieve.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:36:22+00:00Added an answer on June 16, 2026 at 5:36 pm

    If you could apply classes to your td’s you could try this:

    <table cellspacing="0">
        <tr>
            <td class="label">Label1: </td>
            <td>input1</td>
            <td class="label">Label2: </td>
            <td>input2</td>
        </tr>
    </table>​
    

    With the following css:

    table {
        background-color: silver;
        border-collapse: collapse;
    }
    td {
        padding: 5px;
        border: 1px solid red;
        border-width: 1px 1px 1px 0px;
    }
    
    td.label {
        border-width: 1px 0px 1px 1px;    
    }
    

    ​
    http://jsfiddle.net/H3p8e/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a form using text input fields and selectboxes. Each input is
I'm making a form for user creation, and I want to give one or
I am making one of my first databases and am using one table to
I'm styling a form by using a table with fixed-width columns and I want
I'm making a html form using Django Forms. I use BoundFields because my form
I'm using HTML::FormHandler and I'd like to make my form persistent by making it
I am making a form that builds itself from a given db and table.
I'm making a form at the bottom of the screen and I want it
I am trying to work on getting better at making HTML forms using PHP
I am using many get values in one page and making up a hyperlink

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.