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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:02:45+00:00 2026-05-12T05:02:45+00:00

I would like to make all cells of an HTML table clickable–that is, the

  • 0

I would like to make all cells of an HTML table clickable–that is, the link from the anchor tag is active–from any point within a cell. The catch is that the cells have no contents. We are simply using the HTML table to visually represent quantities by coloring the backgrounds of each cell. The cells to contain anchor tags, but no content between the anchor tags.

Below are three examples of tables. In the first table, no dimensions for cells are defined. In the second table, minimum dimensions are defined. In the third table, width and height are explicitly defined. In the first cell of the first row of each table is a simple period character. Notice that in the first and second tables, only that cell is clickable. We would like to avoid explicitly setting height and width, and so if we could get modify either of the first two tables to match the clickable-behavior of the third, that would be fantastic. We could put a non-breaking space ( ) in the anchor tags, but is there another, more elegant solution?

<html>
<head>
  <style>
    td.min {min-width: 1px; min-height: 1px;}
    td.defined {width: 50px; height: 50px;}
    td a.fullcell {width: 100%; height: 100%; display: block;}
  </style>
</head>
<body>
  <h1>No dimension defined</h1>
  <table border="1">
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
    </tr>
    <tr>
      <td>A</td>
      <td bgcolor="#ffbbbb"><a class="fullcell" href="#">.</a></td>
      <td bgcolor="#bbffbb"><a class="fullcell" href="#"></a></td>
    </tr>
    <tr>
      <td>B</td>
      <td bgcolor="#bbffbb"><a class="fullcell" href="#"></a></td>
      <td bgcolor="#ffbbff"><a class="fullcell" href="#"></a></td>
    </tr>
  </table>
  <h1>Min-dimension defined</h1>
  <table border="1">
    <tr>
      <td class="min">1</td>
      <td class="min">2</td>
      <td class="min">3</td>
    </tr>
    <tr>
      <td class="min">A</td>
      <td class="min" bgcolor="#ffbbbb"><a class="fullcell" href="#">.</a></td>
      <td class="min" bgcolor="#bbffbb"><a class="fullcell" href="#"></a></td>
    </tr>
    <tr>
      <td class="min">B</td>
      <td class="min" bgcolor="#bbffbb"><a class="fullcell" href="#"></a></td>
      <td class="min" bgcolor="#ffbbff"><a class="fullcell" href="#"></a></td>
    </tr>
  </table>
  <h1>Dimensions defined</h1>
  <table border="1">
    <tr>
      <td class="defined">1</td>
      <td class="defined">2</td>
      <td class="defined">3</td>
    </tr>
    <tr>
      <td class="defined">A</td>
      <td class="defined" bgcolor="#ffbbbb"><a class="fullcell" href="#">.</a></td>
      <td class="defined" bgcolor="#bbffbb"><a class="fullcell" href="#"></a></td>
    </tr>
    <tr>
      <td class="defined">B</td>
      <td class="defined" bgcolor="#bbffbb"><a class="fullcell" href="#"></a></td>
      <td class="defined" bgcolor="#ffbbff"><a class="fullcell" href="#"></a></td>
    </tr>
  </table>
</body>
</html>
  • 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-12T05:02:45+00:00Added an answer on May 12, 2026 at 5:02 am

    You can find an interesting article (partly) about this problem here.

    I’d personally go for the &nbsp; route: it triggers relatively coherent behaviour (in different browsers) and it is quite commonly used nowadays.

    Another question would be: do you really need tables for layout (is this tabular data)?

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

Sidebar

Related Questions

I'd like to make a custom CellTree that would use checkbox based cells (I
I would like to make all my public variables variables/methods/classes internal when compiling my
I would like to make sure if a textbox has any content at all,
Would like to make anapplication in Java that will not automatically parse parameters used
I would like to make a function that takes in a list of integers
I have an html table, and on each row, i would like to add
I have the following: I would like to make it so that the tableview
I would like make a script using PHP (probably need JS) to send POST
I would like make an extension method for the generic class A which takes
I would like to make sure my classes are robust - even if they

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.