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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:40:18+00:00 2026-05-17T18:40:18+00:00

I have a table of data and each cell is a link. I want

  • 0

I have a table of data and each cell is a link. I want to allow the user to click anywhere in the table cell and have them follow the link. Sometimes the table cells are more than one line but not always. I use td a {display: block} to get the link to cover most of the cell. When there is one cell in a row that is two lines and the others are only one line the one liners don’t fill the entire vertical space of the table row. Here is the sample HTML and you can see it in action here http://www.jsfiddle.net/RXHuE/:

<head>
<style type="text/css">
  td {width: 200px}
  td a {display: block; height:100%; width:100%;}
  td a:hover {background-color: yellow;}
</style>
<title></title>
</head>
<body>
<table>
  <tbody>
    <tr>
      <td>
        <a href="http://www.google.com/">Cell 1<br>
        second line</a>
      </td>
      <td>
        <a href="http://www.google.com/">Cell 2</a>
      </td>
      <td>
        <a href="http://www.google.com/">Cell 3</a>
      </td>
      <td>
        <a href="http://www.google.com/">Cell 4</a>
      </td>
    </tr>
  </tbody>
</table>
</body>
  • 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-17T18:40:19+00:00Added an answer on May 17, 2026 at 6:40 pm

    You need a small change in your CSS. Making td height:100%; works for IE 8 and FF 3.6, but it doesn’t work for Chrome.

    td {
      width: 200px;
      border: solid 1px green;
      height: 100%
    }
    td a {
      display: block;
      height:100%;
      width:100%;
    }
    

    But making height to 50px works for Chrome in addition to IE and FF

    td {
      width: 200px;
      border: solid 1px green;
      height: 50px
    }
    td a {
      display: block;
      height:100%;
      width:100%;
    }
    

    Edit:

    You have given the solution yourself in another post here; which is to use display: inline-block;.
    This works when combined with my solution for Chrome, FF3.6, IE8

    td {
      width: 200px;
      border: solid 1px green;
      height: 100%}
    td a {
      display: inline-block;
      height:100%;
      width:100%;
    }
    

    Update

    The following code is working for me in IE8, FF3.6 and chrome.

    CSS

    td {
      width: 200px;
      border: solid 1px green;
      height: 100%;
    }
    td a {
      display: inline-block;
      height:100%;
      width:100%;
    }
    td a:hover {
      background-color: yellow;
    }
    

    HTML

    <table>
      <tbody>
        <tr>
          <td>
            <a href="http://www.google.com/">Cell 1<br>
            second line</a>
          </td>
          <td>
            <a href="http://www.google.com/">Cell 2</a>
          </td>
          <td>
            <a href="http://www.google.com/">Cell 3</a>
          </td>
          <td>
            <a href="http://www.google.com/">Cell 4</a>
          </td>
        </tr>
      </tbody>
    </table>
    

    The example lays here

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

Sidebar

Related Questions

I have a table, with cells, and each cell has a data-type. I have
I have about 1 million data in users table. Now I want each user
I have an HTML table of data where each cell can have multiple lines
I have a data table filled with text in each table row. How do
Ok, I have a table which contains multiple rows. Each row contains some data
I have data table containing one column as FilePath. FilePath D:\New folder\link.txt D:\New folder\SharepointMigration(Work
I have a table containing data about some users. Many of them use our
I have a table with 150x150 cells which each have a colored background and
I have customized uitableViewcell in which each cell show four data which are related
I have one table with some data. After some event I want to highlight

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.