Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

Commit

Permalink
unindent example.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestalmage committed Dec 19, 2014
1 parent aa38495 commit 5256f0d
Show file tree
Hide file tree
Showing 2 changed files with 415 additions and 415 deletions.
148 changes: 74 additions & 74 deletions example.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
│ hello │ howdy │
└───────┴───────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
[{colSpan:2,content:'greetings'}],
[{colSpan:2,content:'greetings'}],
['hello','howdy']
);
table.push(
[{colSpan:2,content:'greetings'}],
[{colSpan:2,content:'greetings'}],
['hello','howdy']
);

```

Expand All @@ -27,13 +27,13 @@
│ greetings │
└───────────────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
['hello','howdy'],
[{colSpan:2,content:'greetings'}],
[{colSpan:2,content:'greetings'}]
);
table.push(
['hello','howdy'],
[{colSpan:2,content:'greetings'}],
[{colSpan:2,content:'greetings'}]
);

```

Expand All @@ -45,12 +45,12 @@
│ │ │ howdy │
└───────────┴───────────┴───────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
[{rowSpan:2,content:'greetings'},{rowSpan:2,content:'greetings',vAlign:'center'},'hello'],
['howdy']
);
table.push(
[{rowSpan:2,content:'greetings'},{rowSpan:2,content:'greetings',vAlign:'center'},'hello'],
['howdy']
);

```

Expand All @@ -62,12 +62,12 @@
│ howdy │ │ greetings │
└───────┴───────────┴───────────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
['hello',{rowSpan:2,content:'greetings'},{rowSpan:2,content:'greetings',vAlign:'bottom'}],
['howdy']
);
table.push(
['hello',{rowSpan:2,content:'greetings'},{rowSpan:2,content:'greetings',vAlign:'bottom'}],
['howdy']
);

```

Expand All @@ -81,13 +81,13 @@
│ o │ k │ │ │ │
└───┴───┴──┴──┴────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
[{content:'hello',colSpan:2},{rowSpan:2, colSpan:2,content:'sup'},{rowSpan:3,content:'hi'}],
[{content:'howdy',colSpan:2}],
['o','k','','']
);
table.push(
[{content:'hello',colSpan:2},{rowSpan:2, colSpan:2,content:'sup'},{rowSpan:3,content:'hi'}],
[{content:'howdy',colSpan:2}],
['o','k','','']
);

```

Expand All @@ -99,12 +99,12 @@
│ howdy │ │ │
└───────┴───────────┴───────────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
['hello',{rowSpan:2,content:'greetings\nfriends'},{rowSpan:2,content:'greetings\nfriends'}],
['howdy']
);
table.push(
['hello',{rowSpan:2,content:'greetings\nfriends'},{rowSpan:2,content:'greetings\nfriends'}],
['howdy']
);

```

Expand All @@ -118,13 +118,13 @@
│ o │ k │ │ │ │
└───┴───┴──┴──┴────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
[{content:'hello',colSpan:2},{rowSpan:2, colSpan:2,content:'sup\nman\nhey'},{rowSpan:3,content:'hi\nyo'}],
[{content:'howdy',colSpan:2}],
['o','k','','']
);
table.push(
[{content:'hello',colSpan:2},{rowSpan:2, colSpan:2,content:'sup\nman\nhey'},{rowSpan:3,content:'hi\nyo'}],
[{content:'howdy',colSpan:2}],
['o','k','','']
);

```

Expand All @@ -138,13 +138,13 @@
│ d │ │
└───┴───┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
[{content:'a',rowSpan:2},'b'],
[{content:'c',rowSpan:2}],
['d']
);
table.push(
[{content:'a',rowSpan:2},'b'],
[{content:'c',rowSpan:2}],
['d']
);

```

Expand All @@ -160,15 +160,15 @@
│ │ │
└───┴──────┘
```javascript
var table = new Table({style:{head:[],border:[]}});

//notice we only create 3 cells here, but the table ends up having 6.
table.push(
[{content:'a',rowSpan:3,colSpan:2},'b'],
[],
[{content:'c',rowSpan:2,colSpan:2}],
[]
);
var table = new Table({style:{head:[],border:[]}});

//notice we only create 3 cells here, but the table ends up having 6.
table.push(
[{content:'a',rowSpan:3,colSpan:2},'b'],
[],
[{content:'c',rowSpan:2,colSpan:2}],
[]
);
```


Expand All @@ -178,9 +178,9 @@
│ hi… │
└───────┘
```javascript
var table = new Table({rowHeights:[2],style:{head:[],border:[]}});
var table = new Table({rowHeights:[2],style:{head:[],border:[]}});

table.push(['hello\nhi\nsup']);
table.push(['hello\nhi\nsup']);

```

Expand All @@ -192,12 +192,12 @@
│ hi │ hi │
└──────┴──────┘
```javascript
var table = new Table({style:{head:[],border:[]}});
var table = new Table({style:{head:[],border:[]}});

table.push(
[{colSpan:2,content:'hello there'}],
['hi', 'hi']
);
table.push(
[{colSpan:2,content:'hello there'}],
['hi', 'hi']
);

```

Expand All @@ -209,12 +209,12 @@
│ hi │ hi │
└────┴────────┘
```javascript
var table = new Table({colWidths:[4],style:{head:[],border:[]}});
var table = new Table({colWidths:[4],style:{head:[],border:[]}});

table.push(
[{colSpan:2,content:'hello there'}],
['hi',{hAlign:'center',content:'hi'}]
);
table.push(
[{colSpan:2,content:'hello there'}],
['hi',{hAlign:'center',content:'hi'}]
);

```

Expand All @@ -226,22 +226,22 @@
│ hi │ hi │
└────────┴────┘
```javascript
var table = new Table({colWidths:[null, 4],style:{head:[],border:[]}});
var table = new Table({colWidths:[null, 4],style:{head:[],border:[]}});

table.push(
[{colSpan:2,content:'hello there'}],
[{hAlign:'right',content:'hi'}, 'hi']
);
table.push(
[{colSpan:2,content:'hello there'}],
[{hAlign:'right',content:'hi'}, 'hi']
);

```


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

table.push([colors.red('hello')]);
table.push([colors.red('hello')]);

```

Loading

0 comments on commit 5256f0d

Please sign in to comment.