Skip to content

[Support]: malformed tables logs using cli-table3 #97

@guspaz0

Description

@guspaz0

issue trying to render a table in logs

issues when trying to log a table formatted with cli-table3 library. seems no not being taking advantage of full terminal width and its proportional of terminal width.

Image

Code

import CliTable3 from "cli-table3"
import { ConsoleManager } from "console-gui-tools"
    const GUI = new ConsoleManager({
      title: '🎢 Adventure World Management System ',
      logPageSize: 10,
      enableMouse: true,
      overrideConsole: true,
      showLogKey: "ctrl+l",
      layoutOptions: {
          showTitle: true,
          changeFocusKey: 'tab',
          type: 'double',
          boxed: true,
          fitHeight: true,
          pageRatio: [10,16]
      }
    });
    const table = new CliTable3({
      head: ['ID','Name','Type','Capacity','Current','Price','Revenue' ],
      colWidths: [  8,  20,  15,  8,  8,  10,  12  ]
    });

    table.push([ 1, "prueba", "roller coaster",  "50", "0",  `$15`,  `$10000` ]);

    const tableString = table.toString();
    const tableLines = tableString.split('\n');

    tableLines.forEach((line, index) => {
      GUI.info(line)
    });

Library Version

3.7.0

Node Version

22

What operating system are you using?

Windows

Terminal

powershell

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions