All Projects → brunoti → table-link

brunoti / table-link

Licence: other
📂 The easiest way to add links in your table rows, cells or elements that are not anchors!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to table-link

react-use-downloader
Creates a download handler function and gives progress information
Stars: ✭ 65 (+160%)
Mutual labels:  link, anchor
react-bolivianite-grid
React grid component for virtualized rendering large tabular data.
Stars: ✭ 95 (+280%)
Mutual labels:  table
Tkintertable
A pure python library for adding tables to a Tkinter application
Stars: ✭ 199 (+696%)
Mutual labels:  table
Js Equality Game
The Worst Minesweeper 💣 Ever
Stars: ✭ 246 (+884%)
Mutual labels:  table
Vue Easytable
🍉 Table Component/ Data Grid / Data Table.Support Virtual Scroll,Column Fixed,Header Fixed,Header Grouping,Filter,Sort,Cell Ellipsis,Row Expand,Row Checkbox ...
Stars: ✭ 2,501 (+9904%)
Mutual labels:  table
contentful-reference-matrix-field-app
Contentful App that adds UI for a table-like list of references with other associated data.
Stars: ✭ 28 (+12%)
Mutual labels:  table
Flask table
Because writing HTML is fiddly and all of your tables are basically the same
Stars: ✭ 187 (+648%)
Mutual labels:  table
react-datasheet-grid
An Airtable-like / Excel-like component to create beautiful spreadsheets.
Stars: ✭ 227 (+808%)
Mutual labels:  table
get-css-data
A micro-library for collecting stylesheet data from link and style nodes
Stars: ✭ 29 (+16%)
Mutual labels:  link
Tty Table
Terminal table for Windows, Linux, and MacOS. Written in nodejs. Also works in browser console. Word wrap, padding, alignment, colors, Asian character support, per-column callbacks, and you can pass rows as objects or arrays. Backwards compatible with Automattic/cli-table.
Stars: ✭ 233 (+832%)
Mutual labels:  table
Griddle
Simple Grid Component written in React
Stars: ✭ 2,494 (+9876%)
Mutual labels:  table
React Table
⚛️ Hooks for building fast and extendable tables and datagrids for React
Stars: ✭ 15,739 (+62856%)
Mutual labels:  table
au-datatable
Aurelia Datatable, A highly customizable html datatable, build for the Aurelia Framework.
Stars: ✭ 21 (-16%)
Mutual labels:  table
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+9392%)
Mutual labels:  table
ng-treetable
A treetable module for angular 5
Stars: ✭ 32 (+28%)
Mutual labels:  table
React Bootstrap Table
A Bootstrap table built with React.js
Stars: ✭ 2,238 (+8852%)
Mutual labels:  table
Csview
📠 A high performance csv viewer with cjk/emoji support.
Stars: ✭ 208 (+732%)
Mutual labels:  table
Blazortable
Blazor Table Component with Sorting, Paging and Filtering
Stars: ✭ 249 (+896%)
Mutual labels:  table
termtable
Simple and highly customizable library to display tables in the terminal.
Stars: ✭ 41 (+64%)
Mutual labels:  table
tabled
An easy to use library for pretty print tables of Rust structs and enums.
Stars: ✭ 1,337 (+5248%)
Mutual labels:  table

Table Link

Build Status Coverage Status Made with vim

The easiest way to add links in your table rows, cells or elements that are not anchors!

Yeah man... Html can't do that for you out of the box. And it's sad. Very sad.

I KNOW THAT FEEL BRO...

Don't worry bro here is the solution:

Instalation

With npm:

npm install --save table-link

With bower:

bower install --save table-link

Or you can just download a ZIP.

Setup

Browserify
var TableLink = require('table-link');
Browser (Global)
<script src="table-link.min.js"></script>
Some CSS (Optional)
[data-href] {
  cursor: pointer;
}

table [data-href]:hover,
table [data-href]:hover > * {
  background-color: #AAB7D1; // Put whatever color you want... Or none.
}

Usage

In your table:

<tr data-href="http://google.com">
    <td>Some random crazy data.</td>
</tr>

In your Javascript file:

TableLink.init();
// Soooooo simple...

You can make use of blank and self (default) for targeting the link:

<tr data-href="http://google.com" data-target="self">
    <td>Some random crazy data.</td>
</tr>
<tr data-href="http://google.com" data-target="blank">
    <td>Some random crazy data.</td>
</tr>

Using in other elements

Put the selector to find those as the first TableLink.init() parameter like this:
TableLink.init('h1, div, span');
<h1 data-href="http://google.com"></h1>

<div data-href="http://google.com"></div>

<span data-href="http://google.com"></span>

Before and After events

The 'before' event can cancel the link opening by returning false.

The "element" argument is the delegate target, which can be td, tr, th or any element that matches the selector, if it was passed. The "target" argument is the real event target. The sencond can be used to see if the clicked element is the delegated element or some other element inside the delegated element.

TableLink.before(function(element, target) {
    return confirm('Can i open this link?');
});
TableLink.before(function(element, target) {
  // Cancel the action if the clicked element (maybe a cell inside a row[data-href])
  // has the ```.no-link``` class.
  return !target.classList.contains('no-link');
});
TableLink.after(function(element, target) {
    console.log('The link was opened!');
});

License

This repository is under the MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].