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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:39:44+00:00 2026-05-15T08:39:44+00:00

Here is the relevant code (doesn’t work): <html> <head> <title>testing td checkboxes</title> <style type=text/css>

  • 0

Here is the relevant code (doesn’t work):

<html>
<head>
<title>testing td checkboxes</title>
<style type="text/css">
td { border: 1px solid #000; }
label { border: 1px solid #f00; width: 100%; height: 100% }
</style>
</head>
<body>
<table>
  <tr>
    <td>Some column title</td>
    <td>Another column title</td>
  </tr>
  <tr>
    <td>Value 1<br>(a bit more info)</td>
    <td><label><input type="checkbox" /> &nbsp;</label></td>
  </tr>
  <tr>
    <td>Value 2</td>
    <td><input type="checkbox" /></td>
  </tr>
</table>
</body>
</html>

The reason is that I want a click anywhere in the table cell to check/uncheck the checkbox.

edits:
By the way, no javascript solutions please, for accessibility reasons.
I tried using display: block; but that only works for the width, not for the height

  • 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-15T08:39:45+00:00Added an answer on May 15, 2026 at 8:39 am

    I have only tested this in IE 6, 7, 8 and FF 3.6.3.

    <html>
    <head>
    <title>testing td checkboxes</title>
    <style type="text/css">
    tr {
        height: 1px;
    }
    td {
        border: 1px solid #000;
        height: 100%;
    }
    label { 
        display: block; 
        border: 1px solid #f00;
        min-height: 100%; /* for the latest browsers which support min-height */
        height: auto !important; /* for newer IE versions */
        height: 100%; /* the only height-related attribute that IE6 does not ignore  */
    }
    </style>
    </head>
    <body>
    <table>
        <tr>
            <td>Some column title</td>
            <td>Another column title</td>
        </tr>
        <tr>
            <td>Value 1<br>(a bit more info)</td>
            <td><label><input type="checkbox" /> &nbsp;</label></td>
        </tr>
    </table>
    </body>
    </html>
    

    The main trick here is to define the height of the rows so we can use a 100% height on their children (the cells) and in turns, a 100% height on the cells’ children (the labels). This way, no matter how much content there is in a cell, it will forcibly expand its parent row, and its sibling cells will follow. Since the label has a 100% height of its parent which has its height defined, it will also expand vertically.

    The second and last trick (but just as important) is to use a CSS hack for the min-height attribute, as explained in the comments.

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

Sidebar

Related Questions

Here's the relevant code snippet. public static Territory[] assignTerri (Territory[] board, String[] colors) {
Here's the relevant code: public static void printBoarders (Territory x) { int t =
I'm having some trouble with the jQuery hover method. Here's the relevant JavaScript code:
Here's the relevant bit of the source code: class Dice { String name ;
Here's the relevant code: Public class User.cs: public void FindByID(int id) { Parser parser
Here is the relevant code from a Python script where a few commands are
I have a Spring rest service using Spring 3.1.0.RELEASE. Here is the relevant code
here is the relevent code snippet: public static Rand searchCount (int[] x) { int
I have a strange problem with mod_rewrite, the rules that are relevant here are:
I do not seem to understand how to catch constructor exception. Here is relevant

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.