Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
CLI Table 2 [![npm version](https://badge.fury.io/js/cli-table2.svg)](http://badge.fury.io/js/cli-table2) [![Build Status](https://travis-ci.org/jamestalmage/cli-table2.svg?branch=master)](https://travis-ci.org/jamestalmage/cli-table2) [![Coverage Status](https://coveralls.io/repos/jamestalmage/cli-table2/badge.png?branch=master)](https://coveralls.io/r/jamestalmage/cli-table2?branch=master)
===========
cli-table3
===============================================================================

[![npm version](https://img.shields.io/npm/v/cli-table3.svg)](https://www.npmjs.com/package/cli-table3)
[![Build Status](https://travis-ci.com/cli-table/cli-table3.svg?branch=master)](https://travis-ci.com/cli-table/cli-table3)

This utility allows you to render unicode-aided tables on the command line from
your node.js scripts. Based on (and api compatible with) the original [cli-table](https://github.com/Automattic/cli-table),
`cli-table2` is nearly a complete rewrite to accommodate column and row spanning.
It passes the entire original cli-table test suite, and should be a drop in
replacement for nearly all users.
your node.js scripts.

`cli-table3` is based on (and api compatible with) the original [cli-table](https://github.com/Automattic/cli-table),
and [cli-table2](https://github.com/jamestalmage/cli-table2), which are both
unmaintained. `cli-table3` includes all the additional features from
`cli-table2`.

![Screenshot](http://i.imgur.com/sYq4T.png)

Expand All @@ -19,7 +24,7 @@ replacement for nearly all users.
- Better handling of text color that spans multiple lines.
- API compatible with the original cli-table.
- Exhaustive test suite including the entire original cli-table test suite.
- Lots of examples auto-generated from the tests ([basic](https://github.com/jamestalmage/cli-table2/blob/master/basic-usage.md), [advanced](https://github.com/jamestalmage/cli-table2/blob/master/advanced-usage.md)).
- Lots of examples auto-generated from the tests ([basic](https://github.com/cli-table/cli-table3/blob/master/basic-usage.md), [advanced](https://github.com/cli-table/cli-table3/blob/master/advanced-usage.md)).

## Features

Expand All @@ -35,21 +40,21 @@ replacement for nearly all users.
## Installation

```bash
npm install cli-table2
npm install cli-table3
```

## How to use

A portion of the unit test suite is used to generate examples:
- [basic-usage](https://github.com/jamestalmage/cli-table2/blob/master/basic-usage.md) - covers basic uses.
- [advanced](https://github.com/jamestalmage/cli-table2/blob/master/advanced-usage.md) - covers using the new column and row span features.
- [basic-usage](https://github.com/cli-table/cli-table3/blob/master/basic-usage.md) - covers basic uses.
- [advanced](https://github.com/cli-table/cli-table3/blob/master/advanced-usage.md) - covers using the new column and row span features.

This package is api compatible with the original [cli-table](https://github.com/Automattic/cli-table).
So all the original documentation still applies (copied below).

### Horizontal Tables
```javascript
var Table = require('cli-table2');
var Table = require('cli-table3');

// instantiate
var table = new Table({
Expand All @@ -68,7 +73,7 @@ console.log(table.toString());

### Vertical Tables
```javascript
var Table = require('cli-table2');
var Table = require('cli-table3');
var table = new Table();

table.push(
Expand All @@ -85,7 +90,7 @@ Cross tables are very similar to vertical tables, with two key differences:
2. The individual rows take the general form of { "Header": ["Row", "Values"] }

```javascript
var Table = require('cli-table2');
var Table = require('cli-table3');
var table = new Table({ head: ["", "Top Header 1", "Top Header 2"] });

table.push(
Expand Down
2 changes: 1 addition & 1 deletion advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@


##### feel free to use colors in your content strings, column widths will be calculated correctly
![table image](https://cdn.rawgit.com/jamestalmage/cli-table2/c806c2636df97f73c732b41aa913cf78d4ac0d39/examples/screenshots/truncation-with-colors.png)
![table image](./examples/screenshots/truncation-with-colors.png)
```javascript
var table = new Table({colWidths:[5],style:{head:[],border:[]}});

Expand Down
4 changes: 2 additions & 2 deletions basic-usage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##### Basic Usage
![table image](https://cdn.rawgit.com/jamestalmage/cli-table2/c806c2636df97f73c732b41aa913cf78d4ac0d39/examples/screenshots/basic-usage-with-colors.png)
![table image](./examples/screenshots/basic-usage-with-colors.png)
```javascript
// By default, headers will be red, and borders will be grey
var table = new Table({head:['a','b']});
Expand Down Expand Up @@ -111,7 +111,7 @@


##### Use ansi colors (i.e. colors.js) to style text within the cells at will, even across multiple lines
![table image](https://cdn.rawgit.com/jamestalmage/cli-table2/c806c2636df97f73c732b41aa913cf78d4ac0d39/examples/screenshots/multi-line-colors.png)
![table image](./examples/screenshots/multi-line-colors.png)
```javascript
var table = new Table({style:{border:[],header:[]}});

Expand Down