Forum Bugs

Tables show border artifacts when border set to none

Alex3917
I noticed that when rendering tables without borders, in between table cells there is a hairline trace of whatever the background color of the table is. Nothing seems to work to get rid of it: setting borders to none, collapsing borders, setting cell-spacing to 0, etc.

The only workaround I was able to find was setting all borders to 1px, and then setting them to the same color as the cell background so that it just looks like there aren't any borders. Attached is a screenshot showing what I mean, note the hairline gray lines in between cells, which are showing because the background-color on the table is set to black.

Here is a code snippet that shows the issue:

<html>
  <head>
    <style>
    	table { 
    		background-color: black;
    		border: none;
    		border-collapse: collapse;
    	}
    	td { background-color: white; }
    </style>
  </head>
  <body>
    <table>
    	<tr><td>-</td><td>-</td></tr>
    	<tr><td>--</td><td>--</td></tr>
    </table>
  </body>
</html>

  1. prince_table.tiff16.6 kB

Edited by Alex3917

dauwhe
Interesting. I'm seeing the borders in Preview (for OS X) but not in Acrobat.
Alex3917
Ahh. I see them in both OS X preview and also in Skim PDF. I didn't try Acrobat.
mikeday
It is difficult to avoid hairline traces of color when overlaying two different shapes, as it depends on the accuracy of the PDF viewer. Often they are dependent on zoom level, and disappear as you zoom in. In general, the only workaround is to avoid this situation, unfortunately.
Alex3917
That makes sense, thanks!