Giter Club home page Giter Club logo

Comments (3)

ayonious avatar ayonious commented on August 24, 2024

Good idea. Yes definitely a good feature

from console-table-printer.

ayonious avatar ayonious commented on August 24, 2024

@rjbudzynski if you add the columns this way that should work as I see from examples.
https://console-table.netlify.app/docs/doc-column-title

from console-table-printer.

ayonious avatar ayonious commented on August 24, 2024

Here is a detailed test case I made which shows there is infact order for columns.

const p = new Table({
      columns: [
        { name: 'eighty' },
        { name: 'index', alignment: 'left', color: 'yellow' },
        { name: 'text', alignment: 'right' },
        { name: 'third' },
        { name: 'fourth' },
        { name: 'twelve' },
        { name: 'fifth' },
        { name: 'sixth' },
        { name: 'seventh' },
      ],
    });

    p.addRow({ index: 1, text: 'red wine', value: 10.212 }, { color: 'green' }); // row coloring

    p.addRow({ index: 2, text: 'green gemuse', value: 20.0 });
    p.addRow(
      {
        text: 'gelb bananen',
        value: 100,
        third: 3,
        fifth: 7,
        is_priority_today: 'Y',
        fourth: 4,
      },
      { color: 'yellow' }
    );
    p.addRow(
      {
        sixth: 6,
        seventh: 7,
        index: 3,
        text: 'rosa hemd wie immer',
        value: 100,
      },
      { color: 'cyan' }
    );
    p.addRow(
      {
        sixth: 6,
        seventh: 7,
        twelve: 3,
        eighty: 'rosa hemd wie immer',
      },
      { color: 'green' }
    );
    p.printTable();

Output looks like this:
Cursor_und_testCOlumnOrder_test_ts_—_my-npm-packages-tester-ts

From code as well the columns is an array in which there is an order and it can be controlled by the order in Table creation

So closing this issue. If this still happen feel free to re open it

from console-table-printer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.