I have set the border of the table to 1 as you advised and actually you are right. The gap is occurring when the cell containing the horizontal line part is stretched out. In the html file preview that cell is not stretched out and everything looks fine. But for some reason when the html preview is converted to pdf, that cell get stretched.

Is there a way to avoid this…?