1.1.0 • Published 5 years ago

a11ytable v1.1.0

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

a11ytable

This is a simple accessible hidden table to supplant charts for voice readers.

Usage

const data = [
  { "name":"Larry Wall", "age":57, "link": "<a href='http://www.wall.org/~larry/'>www.wall.org/~larry/</a>" },
  { "name":"Bill Gates", "age":56, "link": "<a href='http://www.microsoft.com'>www.microsoft.com</a>" },
  { "name":"Daffy Duck", "age":75, "link": "" }
];

const headers = { "name" : "User name", "age": "User age", "link": "Homepage" };
const table = new a11ytable({ headers, data });

document.getElementById('chart-hidden-table').innerHTML = table.render();

API

Table of Contents

a11ytable

This function takes header settings and data to generate a HTML table string.

Parameters

  • obj Object Generic es6 destructuring params.
    • obj.headers (optional, default [])
    • obj.data (optional, default [])
    • obj.caption (optional, default '')

Returns any An html table string.

1.1.0

5 years ago