Skip to content

Commit 9fddb74

Browse files
authored
feat: Feature/comprehensive docs validation tests (#123)
1 parent fb534ed commit 9fddb74

File tree

5 files changed

+901
-19
lines changed

5 files changed

+901
-19
lines changed

docs/api/configuration.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface TableOptions {
2626
rows?: RowData[];
2727

2828
// Table styling
29-
style?: TableStyle | CustomStyle;
29+
style?: CustomStyle;
3030

3131
// Sorting function
3232
sort?: (row1: RowData, row2: RowData) => number;
@@ -72,8 +72,8 @@ const table = new Table({
7272
{ id: 2, name: "Jane", age: 30 }
7373
],
7474

75-
// Table styling
76-
style: "fatBorder",
75+
// Table styling (using default style)
76+
// style: customStyleObject, // Use custom style object if needed
7777
title: "Employee Directory",
7878

7979
// Sorting by age in descending order
@@ -396,20 +396,22 @@ const table = new Table({
396396

397397
Pre-defined table border styles.
398398

399-
```typescript
400-
type TableStyle = "fatBorder" | "thinBorder" | "noBorder";
401-
```
399+
The style property accepts a `TableStyleDetails` object or can be omitted to use the default style.
402400

403401
**Examples:**
404402
```javascript
405-
// Fat border (thick lines)
406-
const table = new Table({ style: "fatBorder" });
407-
408-
// Thin border (thin lines)
409-
const table = new Table({ style: "thinBorder" });
410-
411-
// No border
412-
const table = new Table({ style: "noBorder" });
403+
// Default border style (will use built-in default style)
404+
const table = new Table();
405+
406+
// Custom border style
407+
const table = new Table({
408+
style: {
409+
headerTop: { left: "", mid: "", right: "", other: "" },
410+
headerBottom: { left: "", mid: "", right: "", other: "" },
411+
tableBottom: { left: "", mid: "", right: "", other: "" },
412+
vertical: ""
413+
}
414+
});
413415
```
414416

415417
## Function Signatures

docs/api/core-functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const table = new Table({
8787
{ name: "name", alignment: "center" },
8888
{ name: "age", alignment: "right", color: "green" }
8989
],
90-
style: "fatBorder",
90+
// Default style will be used (omit style property for default borders)
9191
title: "User Data",
9292
sort: (row1, row2) => row1.id - row2.id,
9393
filter: (row) => row.age >= 18
@@ -175,7 +175,7 @@ const table = new Table({
175175
],
176176

177177
// Table styling
178-
style: "fatBorder",
178+
// Default style will be used (omit style property for default borders)
179179
title: "Employee Directory",
180180

181181
// Sorting by age in descending order

docs/api/table-methods.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ console.log(tableString);
235235
**Advanced Usage:**
236236
```javascript
237237
const table = new Table({
238-
title: "User Report",
239-
style: "fatBorder"
238+
title: "User Report"
239+
// Default style will be used (omit style property for default borders)
240240
});
241241

242242
table.addRows([

docs/doc-table-instance-creation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ new Table(["column1", "column2", "column3"]);
5555

5656
```javascript
5757
new Table({
58-
style: "fatBorder", //style of border of the table, (optional)
58+
// Default style will be used (omit style property for default borders)
5959
columns: [
6060
{ name: "column1", alignment: "left", color: "red" }, //with alignment and color
6161
{ name: "column2", alignment: "right" },

0 commit comments

Comments
 (0)