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 8585259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:00:55+00:00 2026-06-11T22:00:55+00:00

I am using a table inside fieldset and there is a gap below legend,

  • 0

I am using a table inside fieldset and there is a gap below legend, I wand to remove it. I tried using padding:0px and margin:0px on both fieldset and legend inline style. But none worked. Please help me with some suggestions.

Thanks!

Edit:

The code is very huge since I am using select menu. But here is the overview of the code.

<fieldset>
          <legend><b>Options</b></legend>
          <table>
            <tr>
              <td colspan="1"><label>Passengers:&nbsp; </label></td></tr></table>    
</fieldset>

margin and padding is working for fieldset but it is doing nothing for legend. Is there any way to remove the gap produced by legend?

  • 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-11T22:00:57+00:00Added an answer on June 11, 2026 at 10:00 pm

    Default rendering may include padding intended to make the document appearance legible. The defaults vary by browser, but they may include vertical padding on fieldset and legend, and they almost certainly include vertical padding on td elements. To remove such padding, you can set:

    legend { 
      padding-top: 0;
      padding-bottom: 0;
    }
    fieldset, td { 
      padding-top: 0;
    }
    

    But there’s also spacing between table cells by default, and this means that there is some spacing around a cell even in a single-cell table. The cross-browser way to remove that is:

    table {
      border-collapse: collapse;
    }
    

    Adding this removes the spacing between the legend and the cell content (you can see this by setting background colors on the legend and label elements) on IE and Chrome. On Firefox, a one-pixel gap seems to remain, with no obvious explanation.

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

Sidebar

Related Questions

In my android appl;ication I am using a table inside a scrollview and below
We are using windows azure table for logging errors within our applications hosted inside
How do I differentiate between elements inside a table that is populated using a
I'm trying to reset some input text fields, inside of a data table, using
I am trying to print a table inside an e-mail using plain text. I
I am using navigation controller and have table views inside views. when i select
I'm dynamically adding rows to a table using jQuery. The table is inside a
I´m trying to get the values of TDs inside a table using WatiN. The
I have configured spring security core plugin using requestmap table inside the database.. Now
I have table td inside that am using another table but text and fields

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.