Giter Site home page Giter Site logo

ascii-table's Issues

Add ability to only draw data seperator after specific lines

I would like to group certain set's of data together, and only seperate those sets with a seperator line.

Eg:

┌────────────┬──────┬─────────┐
│ A          │ B    │ C       │
├────────────┼──────┼─────────┤
│ 2024.2     │ 2    │ 24      │
│ 2024.1     │ 2    │ 21      │
├────────────┼──────┼─────────┤
│ 2023.12    │ 2    │ 3       │
│ 2023.11    │ 1    │ 23      │
....

Is it currently possible to archieve this?
Thanks for the great library!

Custom line/row separator

This is my table format

id   column1        column2                    column3          
---- --------------- ------------------------------ ------------------ 
 1   data11       data12                           data13
 2   data21       data22                           data23
 3   data31       data32                           data33
 4   data41       data42                           data43

I need to have empty line between each record to view the data clearly.

Cut column in start instead of end

I would like to be able to cut the column value in the start, so the visible text is the suffix text, eg

I have this class name sample.camel.MyCamelApplication which are shown in full in the PS command below

~/workspace ❯ camel ps
  PID   NAME                             AGE
 61818  sample.camel.MyCamelApplication   5s

However in the next command with more details I want to cut the class name in the beginning, eg:

~/workspace ❯ camel get
  PID   NAME                          CAMEL            PLATFORM            READY   STATE   AGE  TOTAL  FAILED  INFLIGHT  SINCE-LAST
 61818  sample.camel.MyCamelApplica…  3.19.0-SNAPSHOT  Spring Boot v2.7.3   1/1   Started   9s      3       0         0          0s

Should be `....camel.MyCamelApplication`

PS: Thanks for implementing the other features so quickly, we use this table library with joy at Apache Camel for our new CLI.

using AsciiTable as email body

Hi, I hope it's ok to ask this here. I am using AsciiTable to create an email body and it seems to work fine on thunderbird, but its a bit broken on windows outlook.

i get this nice table in thunderbird:
image

this is what it displays on outlook

image

does anyone know anything i can do to get this working on outlook better? or any suggestions will be appreciated

Make it possible to cut column data instead of word wrapping when using maxColumnWidth

Great utility, we started using this with Apache Camel

We print a table with Camel route status, and instead of word wrapping then I would like to make it automatic cut the excess length

new Column().header("Name").dataAlign(HorizontalAlign.LEFT).maxColumnWidth(30).with(r -> r.name),
new Column().header("Route ID").dataAlign(HorizontalAlign.LEFT).maxColumnWidth(30).with(r -> r.routeId),
new Column().header("From").dataAlign(HorizontalAlign.LEFT).maxColumnWidth(30).with(r -> r.from),

See screenshot for an example of what it does today with word wrap.

Add a utility method to get table rows as Collection

It would be flexible if you provide a utility method that simply returns collection of rows in the table.
To say exactly the result of below method.
private static List<String> getTableRows(int[] colWidths, HorizontalAlign[] headerAligns, HorizontalAlign[] dataAligns, HorizontalAlign[] footerAligns, Character[] borderChars, String[] header, String[][] data, String[] footer) {

Using colour output leads to table miss alignment

I am experimenting with adding colour output via
https://github.com/fusesource/jansi

This is what for example Apache Maven, Spring Boot, etc uses to log in colour.

I wanted to mark Camel components that are in preview mode with a yellow colour, that are in a middle column. When doing this then the column width gets larger ... I just wanted to let you know and we can maybe work on having better color support over time.

See the screenshot below

Ansi color glitch in adjacent cell

Hi

Many thanks for this great table printer.

Just in case you want to see what we have been up to of late with Apache Camel, then we have a panel in the middle with 2 columns. When using ansi color then the 2nd panel will start out of position.

I think you have been aware of this and its tricky to solve. But just wanted to show you a real world use of this great util.

Screenshot 2023-11-03 at 13 11 28

Make it easier to define table structure and afterwards to select which columns to print

At Apache Camel we have a CLI that allows to output data in tables, and we want to allow the table to output only specific columns depending on CLI arguments. (for example a --wide mode to list more etc.)

However it is a bit too difficult to make it possible to define the table once with all the columns, alignment, min/max width etc, and then afterwards be able to select which columns to include when printing the table.

So what we have done is to copy the table and have "ugly" if ... elseif ... code in Camel.

Here is a little example whether GAV is enabled or not
https://github.com/apache/camel/blob/main/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/catalog/CatalogBaseCommand.java#L77

Adding a column that spans entire table as child to each row

At Apache Camel we have a new for a master/child row that is something ala

Column A | Column B | Column C | Column D
Column E that spans the entire line
Column A | Column B | Column C | Column D
Column E that spans the entire line
Column A | Column B | Column C | Column D
Column E that spans the entire line

I only need one special column. Maybe something you can add as the last column in a table, and specify that is a child column or something.

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.