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

  • SEARCH
  • Home
  • 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 8347267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:18:39+00:00 2026-06-09T07:18:39+00:00

I’m using a <table> to layout a standard HTML contact form. Let’s not discuss

  • 0

I’m using a <table> to layout a standard HTML contact form. Let’s not discuss the merits of using a table given that HTML should not be about presentation but structure (which is why I believe it’s justified anyway).

Nonetheless, here is the markup and CSS I’m using (as-generated by ASP.NET MVC):

            <table class="fieldTable">
                <tbody>
                    <tr>
                        <th><label for="Name">Your name</label></th>
                        <td><input id="Name" name="Name" type="text" value="" /></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                    </tr>

                    <tr>
                        <th><label for="EmailAddress">Your e-mail address</label></th>
                        <td><input id="EmailAddress" name="EmailAddress" type="text" value="" /></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                    </tr>

                    <tr>
                        <th><label for="MessageBody">Message</label></th>
                        <td><textarea cols="30" id="MessageBody" name="MessageBody" rows="6"></textarea></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                    </tr>

                    <tr>
                        <td></td>
                        <td><button type="submit"><span>Send Message</span></button></td>
                    </tr>
                </tbody>
            </table>

And my CSS:

.fieldTable th {
    text-align: right;
    font-weight: normal;
    vertical-align: top;
    padding: 0.25em;
    padding-right: 0.5em; }

.fieldTable input,
.fieldTable textarea,
.fieldTable button {
    width: 100%; }

input, textarea, button {
    border: 1px solid #999;
    padding: 0.5em;

    border-radius: 5px;
    -webkit-box-shadow: 0px 0px 7px 3px #c4c4c4;
    box-shadow: 0px 0px 7px 3px #c4c4c4; }

button        { background: #DDD; position: relative; }
button:hover  { background: #FFF; }
button:active span { position: relative; top: 2px; left: 2px; }

tr { outline: 1px solid blue; }
td { outline: 1px solid red; }

However it seems to render like this:

Normal rendering
Rendering with tr/td outlines

Why isn’t the <button> element filling the cell horizontally?

  • 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-09T07:18:41+00:00Added an answer on June 9, 2026 at 7:18 am

    I think you might be looking for box-sizing, it is what determines if the margin/padding get added or excluded when calculating the width/height.

    box-sizing: border-box;

    That should allow you to set a percentage width/height and it will fill without spilling over.

    EDIT: It is on button by default (if you inspect the element you will see the browser already adds it). It can be added to your textareas and input fields to get them to match up with your buttons.

    If you look at your screen shots. The input fields are going outside of the TDs and the button seems to be the only one really behaving.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.