CheckBoxList - how do I remove gap created by TBODY?

Posted on 2011-04-20
Last Modified: 2012-05-11

I have a check box list control, and the way ASP.NET outputs the HTML for this is


This leaves a small line of empty space from where the table starts, and the tbody starts.  How do I remove this gap?  Or Top Align the tbody?

Here's an attempted display of what it looks like in a browser

<top of the table>
| this is the gap I want to remove
<tbody begin>
| rows & cells here
| --------
|rows & cells here
Question by:krapvag
    LVL 13

    Expert Comment

    Try playing with the padding and spacing attributes.
    LVL 7

    Accepted Solution

    Add this to your CSS:

    tbody { margin: 0px; padding: 0px; }

    Featured Post

    Training Course: Adobe Photoshop CC 2015

    Photoshop has become the standard in image manipulation among professional photographers and graphic designers. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    Join & Write a Comment

    Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
    In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now