Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table with border and table auto layout #21

Open
nauman-matloob opened this issue Aug 19, 2023 · 1 comment
Open

Table with border and table auto layout #21

nauman-matloob opened this issue Aug 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@nauman-matloob
Copy link

Hello, i have 2 questions.

  1. i'd like to know if there is a possiblity to add border to the table.
  2. i'd like to know how can i have the auto width between 2 columns.
    here is an exemple of what i am currently doing (table):
 .table(
        [
          { width: 26, align: 'left' },
          { width: 10, align: 'right', marginRight: 2, }
        ],
        order.products.reduce((a, b) => {
          a.push([
            (encoder) => encoder.bold()
              .width(2)
              .height(2)
              .align('left')
              .text(b.name),
            (encoder) => encoder.bold()
              .align('right')
              .text(b.qty.toString())
              .width(1)
              .height(1)]);
          return a;
        }, [])
      )

but my problems is that the 1st column doesn't have an auto width and the right column does not stick on the position.
also my 1st column doesn't have always the same text length.
is there a problem with my code ?

@NielsLeenheer NielsLeenheer transferred this issue from NielsLeenheer/EscPosEncoder Sep 21, 2024
@NielsLeenheer
Copy link
Owner

Table borders are currently not supported. That may be added in the future. The latest release does have many inprovements in table rendering and should fix most issues with columns not being the right size.

@NielsLeenheer NielsLeenheer added the enhancement New feature or request label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants