Table border: [] fails
lucianosousa opened this issue · 3 comments
I've set a no border on my table but there is still some strange line in the middle of columns/rows as you can see in the image above:
here are my code:
pdf.table(table_content, cell_style: cell_style, width: pdf.bounds.width + 45) do
rows(-1).padding = [1, 1, 5, 1]
rows(0).padding = [5, 1, 1, 1]
end
---
def table_content
[
['SAC - Serviço de atendimento ao cliente', '', 'SAC - Serviço de atendimento ao cliente'],
['Exclusivo para reclamações ou cancelamento', '', 'Deficiência auditiva ou de fala'],
['0800 723 2245', '', '0800 722 0270']
]
end
def cell_style
{
size: 6,
align: :center,
borders: [],
border_width: 0,
padding: 1,
background_color: COLORS[:third_color]
}
end
There is anything I'm missing or this borders: [] is not working properly?
This is a rendering artefact. Even without border each cell’s background is drawn separately. That is, for each cell there’s a separate rectangle drawn. Yo may see seams between the rectangles. This effect is more prominent when the document is displayed at scale other than 100%. AFAIK, all renderes demonstrate this flaw to a verging degree.
I’d argue this is not a prawn-table bug. This is most certainly a renderer issue (not really a bug, though).
Technically, prawn-table could draw background of adjacent cells as one plygon but this optimisation would make the code much more complex. Not that we wouldn’t accept it, just no one contributed it yet.
I’ll close this issue now since this is not a bug. Feel free to reopen if you can demonstrate that it is actually a bug. Also feel welcome to contribute background merging.
@pointlessone do you same some idea how to remove this line? because I've tried couple configs here and seems none one works fine
You can’t. Open document at 100% scale and see if it goes.
You can try setting a thin grey border for the affected cells by that may not fit your design.