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

Internal table cells render incorrectly #126

Open
rytkmt opened this issue Jun 17, 2021 · 1 comment
Open

Internal table cells render incorrectly #126

rytkmt opened this issue Jun 17, 2021 · 1 comment

Comments

@rytkmt
Copy link

rytkmt commented Jun 17, 2021

Hey, first thanks for the great gem!

I wanna render like this.

image

but,

image

    inner_cell = make_table([["A"],["B"]]) { column(0).style(width: 70) }
    information_column_cell = make_table(
      [
        ["", ""],
        [{ content: "aa", colspan: 2 }],
        ["X", inner_cell],
        [{ content: "bb", colspan: 2 }],
      ],
      column_widths: [30, 70]
    ) do
      row(0).style(height: 0)
    end

    table(
      [
        ["", "", "", ""],
        ["a", information_column_cell, "b", "c"]
      ],
      column_widths: [100, 100,100,100]
    ) do
      row(0).style(height: 0)
    end

It can't render internal table cells correctly.

I do not know why, But I happened to render it correctly.

    inner_cell = make_table([["A"],["B"]]) { column(0).style(width: 60) }

    information_column_cell = make_table(
      [
        ["", "", ""],
        [{ content: "aa", colspan: 3 }],
        ["X", { content: inner_cell, colspan: 2 }],
        [{ content: "bb", colspan: 3 }],
      ],
      column_widths: [40, 60, 0]
    ) do
      row(0).style(height: 0)
    end

If i specify the height, it will be drawn incorrectly as well.

    inner_cell = make_table(
      [
        [{
          content: "A",
          height: 100
        }],
        [{
          content: "B",
          height: 200
        }],
      ]
    ) {

      column(0).style(width: 60)
    }

image

thanks.

@raquelhortab
Copy link

This happens to me too, quite a headache... But then I've read somewhere that this project is stable enough not to improve it further...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants