Giter Club home page Giter Club logo

Comments (2)

pulketo avatar pulketo commented on June 16, 2024

there is a way... some calculations needed...
$width = trim(system("tput cols")); //get the width of the screen
but i guess this guy has abandoned this awesome project

from clitable.

conrad10781 avatar conrad10781 commented on June 16, 2024

I've added this functionality to my fork of the project ( conrad10781@9b68c09 )

You can either merge into your fork, or use my fork.

Only update that's needed is a change of your initialization of CliTable. There is now a third parameter to center the table, which is false by default, so not to break any existing installs. I also have a fix to #6 if you were doing that which currently has a PR on this project. If that gets merged, I'll submit a PR for the table centering and you won't need my project.

In any event, if you previously used something like:

$table = new CliTable;

It will now need to be something like the following. Most important part is the 3rd parameter, which needs to be true to center.

$table = new CliTable('Row', true, true);

One other key point, in my usage of the library, I have occasionally created tables larger than the width of my screen. If that's the case, it doesn't matter whether or not you pass "true", the value will be ignored unless there is available space to center.

from clitable.

Related Issues (4)

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.