GithubHelp home page GithubHelp logo

melvinidema / clicktable Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 190 KB

A super lightweight package to make your table rows clickable like an anchor link

Home Page: https://clicktable.dev

License: MIT License

JavaScript 100.00%

clicktable's Introduction

Clicktable (/klɪktəbl/ like clickable) is a lightweight module to help you easily make your table rows act like anchor links.

Installation

First update NPM and install clicktable in your dependencies:

npm i -g npm
npm i --save clicktable

Then require and initialize Clicktable:

const Clicktable = require("clicktable");
const clickMe = new Clicktable();

Now all you need to do is add the data-href attribute to your table rows:

<table>
  <tr>
    <th>Package</th>
    <th>Version</th>
    <th>Language</th>
  </tr>
  <tr data-href="https://www.npmjs.com/package/clicktable">
    <td>Clicktable</td>
    <td>1.1.0</td>
    <td>Javascript</td>
  </tr>
</table>

Done! Your table rows now act like a normal anchor link: Demonstration

Options

Since V1.1.0 Clicktable automatically inserts a default styling. This styling is the same as the user-agent styling of most modern browsers for anchor links and is easily overwritten in your CSS style. If you want to manually shut off the default styling just pass "style": "none" as option.

const clickMe = new Clicktable({
  style: "none"
});

clicktable's People

Contributors

melvinidema avatar dependabot[bot] avatar

Watchers

 avatar

clicktable's Issues

Use outside package for handling CSS insertion

Clicktable has its own function to insert CSS right now. Considering using "insert-css" NPM package for handling the CSS.

Pro's:

  • Better browser support
  • Less bloated code

Con's:

  • More dependencies, bigger project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.