How do I make a table cell a link without onclick?

Hi all,

Pretty basic question, but didn't find a solution yet.
I have a search page and the result is shown as a table, every row has an on click redirection to a page. I have a feeling the google doesn't crawl these links, so I would like to change these to proper links, but no luck.

<a href="link">
  <tr>
    <td dmx-text="text">
    </td>
    <td dmx-text="text">
    </td>
  </tr>
</a>

Putting a link inside a cell is not ideal as I have multiple cells in a row, users also got used to just click anywhere within the row...

Any idea?

Gabor

Well you pretty much answered your question :slight_smile:
You have two options - either add an onclick event to the <tr> or add an anchor tag in each <td>. Or just don't use tables, you can recreate the table layout using divs and use the standard BS5 flex classes to align them and make them look like tables.
Wrapping a table row in an anchor tag is not correct.

1 Like