edadma / table

a very small class to do tables for stdout and command line REPL's

GitHub

table

a very small class to do tables for stdout and command line REPL's

Example

import xyz.hyperreal.table.TextTable

object Main extends App {
  val t =
    new TextTable {
      header( "one", "two", "three" )
      line
      row( 1, 2, 3 )
      row( 12, 234, 3456 )
      
      1 to 3 foreach rightAlignment
    }
  
  print( t )
}

output:

+-----+-----+-------+
| one | two | three |
+-----+-----+-------+
|   1 |   2 |     3 |
|  12 | 234 |  3456 |
+-----+-----+-------+

License

distributed under the MIT License, meaning that you are free to use it in your free or proprietary software.

Usage

Add the following elements to use it in your Maven project:

<repository>
	<id>hyperreal</id>
	<url>https://dl.bintray.com/edadma/maven</url>
</repository>

<dependency>
	<groupId>xyz.hyperreal</groupId>
	<artifactId>table</artifactId>
	<version>0.1</version>
</dependency>

Add the following to your build.sbt file to use it in your SBT project:

resolvers += "Hyperreal Repository" at "https://dl.bintray.com/edadma/maven"

libraryDependencies += "xyz.hyperreal" %% "table" % "0.1"

Building

Requirements

  • SBT 13.9+
  • Java 8+

Clone and build

git clone git://github.com/edadma/table.git
cd table
sbt test