Title: Cell link
Last modified: April 15, 2020

---

# Cell link

 *  Resolved [Canopie Ventures](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/)
 * Hi Tobias,
 * Thanks for the great plugin!
 * How do you turn a cell into a link? So, if the visitor clicks on any part of 
   the cell, it would take them to a url.
 * Thanks,
    Steve

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12676756)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * I’m afraid that that is not directly possible, due to how links on the web work.
   You would need to use JavaScript to emulate that. For example, you could use 
   JavaScript like [https://wordpress.org/support/topic/make-row-clickable/#post-4131178](https://wordpress.org/support/topic/make-row-clickable/#post-4131178)
   
   If you change the `'tr'` to `'td'`, this would apply to all table cells individually,
   instead of just rows.
 * Regards,
    Tobias
 *  Thread Starter [Canopie Ventures](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12680027)
 * Hi Tobias,
 * Thanks, I did see that post, but wasn’t sure how to do it for specific cells,
   not rows.
 * I’ll try that method.
 * In this scenario, if I have 1 row with 2 columns, and I only want the 2nd cell
   to be clickable how would I do this?
 * Thanks,
    Steve
 *  Thread Starter [Canopie Ventures](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12680133)
 * Would something like this work?
 * .tablepress-id-4 .column-2 td a {
    display: block; position: relative; }
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12680342)
 * Hi,
 * no, that would not help, I’m afraid, as this is CSS code that would only affect
   the styling.
 * You could try adding this JavaScript code below the table Shortcode on the page
   where you are displaying the table:
 *     ```
       <script>
       jQuery(document).ready(function($){
         $('.tablepress-id-1').on( 'click', '.column-2', function() {
           const $a = $(this).find('a');
           if ( $a.length )
             window.location = $a.attr('href');
         } );
       });
       </script>
       ```
   
 * Make sure to change the `.tablepress-id-1` part to the correct table ID.
 * Regards,
    Tobias
 *  Thread Starter [Canopie Ventures](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12681107)
 * Where do you put the url?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12681986)
 * Hi,
 * you would insert a normal link into the cell. That link would then be clicked“
   virtually” when you click anywhere in the cell.
 * Regards,
    Tobias
 *  Thread Starter [Canopie Ventures](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12686432)
 * Doesn’t work.
 * Thanks for your help. I know you’re offering free support and I appreciate it.
 * This is the page: [https://www.greenpointloans.com](https://www.greenpointloans.com)(
   the yellow button “start here” is the cell)
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12687906)
 * Hi,
 * ok, you’ll need to modify the CSS for this cell a bit, because the padding in
   the cell would not be clickable.
    Please change the “Custom CSS” for that column
   to
 *     ```
       .tablepress-id-4 .column-2 {
           width: 280px;
           background-color: #FCDC3B;
           text-align: center;
           padding: 0!important;
           vertical-align: middle;
           line-height: 150px;
       }
       ```
   
 * It might then actually be possible to remove the JavaScript code as the link 
   already spans the full cell.
 * Regards,
    Tobias
 *  Thread Starter [Canopie Ventures](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12691432)
 * Hi Tobias,
 * It worked with these:
 *     ```
       .tablepress-id-4 .column-2 {
       	width: 280px;
       	background-color: #FCDC3B;
       	text-align: center;
       	padding: 0 !important;
       	vertical-align: middle;
       	line-height: 150px;
       }
   
       .tablepress-id-4 .column-2 a {
       	color: #000;
       	display: block;
       	position: relative;
       }
       ```
   
 * When I removed the (.tablepress-id-4 .column-2 a) CSS part, it would not work.
 * I was also able to remove the javascript from the page.
 * Thanks again,
    Steve
    -  This reply was modified 6 years, 1 month ago by [Canopie Ventures](https://wordpress.org/support/users/sbwebmaster/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12693024)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Cell link’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/cell-link/#post-12693024)
 * Status: resolved