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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:00:17+00:00 2026-05-25T23:00:17+00:00

I have a grid of checkboxes where each cell has a fixed width, and

  • 0

I have a grid of checkboxes where each cell has a fixed width, and each checkbox is preceded with a small image. In cases where the label text is too long, I’m having a hard time getting the text to wrap underneath the checkbox.

screenshot 1

Referring to the above screenshot, I’d like “text that wraps” to be aligned with the checkbox, rather than wrapping underneath the image, like so:

screenshot 2

I’ve set up a fiddle with my current markup and styles. What I can’t change is the HTML structure, but any CSS changes are fine.

Here is a code snippet:

.checkbox-list {
}
img.placeholder{
    width:16px;
    height:16px;
    background-color:lightblue;
}
td {
    padding:2px;
    width:150px;
    vertical-align:top;
}
label {
    /*display:inline-block;*/
}
<table class="checkbox-list">
    <tbody><tr>
        <td>
            <img class="placeholder"/>
            <label>
                <input type="checkbox"/>
                <span>Some really long text that wraps</span></label></td>
        <td>
            <img class="placeholder"/>
            <label>
                <input type="checkbox"/>
                <span>Foo</span></label></td>
        <td>
            <img class="placeholder"/>
            <label>
                <input type="checkbox"/>
                <span>Foo</span></label></td>
    </tr><tr>
        <td>
            <img class="placeholder"/>
            <label>
                <input type="checkbox"/>
                <span>Foo</span></label></td>
        <td>
            <img class="placeholder"/>
            <label>
                <input type="checkbox"/>
                <span>Foo</span></label></td>
        <td>
            <img class="placeholder"/>
            <label>
                <input type="checkbox"/>
                <span>Foo</span></label></td>
    </tr>
</tbody></table>
  • 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-05-25T23:00:18+00:00Added an answer on May 25, 2026 at 11:00 pm

    You could just apply a margin-bottom to the image and float: left:

    img.placeholder{
        width:16px;
        height:16px;
        background-color:lightblue;
        margin-bottom: 1em;
        float: left;
    }
    

    JS Fiddle demo.


    Edited because I am, apparently, an idiot, and didn’t realise the simplest approach was to assign the display: block; and margin-left: 18px; to the label element, and float the .placeholder elements:

    img.placeholder{
        width:16px;
        height:16px;
        background-color:lightblue;
        float: left;
    }
    
    label {
        display: block;
        margin-left: 18px;
    }
    

    JS Fiddle demo.

    Floating the image prevents the label from starting on a new-line, the margin-left on the label is the width of the image and a small 2px ‘gutter’ to visually separate the image and the checkbox (adjust to taste, obviously).

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

Sidebar

Related Questions

I have a devexpress grid: each row has a checkbox and a text column,
Currently I have a grid with a bunch of checkboxes - When a checkbox
I have a grid with one TemplateField which is a checkbox and say 2
I have added checkbox selection model to grid panel. It works fine in IE8
I have grid of images, when the mouse is over any given image a
I have a grid that has multiple rows. I want to hide/show one of
In my Windows Phone Mango app, I have a bunch of checkboxes, each corresponding
I have a grid of Enum Flags in which each record is a row
Explanation: I have a grid with a checkbox column where users can check records
Context: I have a data grid where the following has been implemented. tabbing through

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.