Comments (2)
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clitable.