table-tr-href
Simple library with no dependencies that wrap <td>
cell content in a <a>
tag for an entire <tr>
row
Table of Contents
Demo
Installation
npm install --save table-tr-href
Usage
// This will create window.TableTrHrefconst TableTrHref =
Examples
You can force rendering a DOMElement:
// on document readydocument;
The example above will transform this html:
Column A Column B The entire row is a link The entire row is a target _blank link
Into:
Column A Column B The entire row is a link The entire row is a target _blank link
Style
By default, <a>
wrappers are:
You can easily customize the hover color:
Cancel default <a>
style:
If your <td>
tags have padding (let's take 0.75rem for this exammple), you can apply it to the <a>
tags instead: