If you’ve ever used a DataFormWebPart in SharePoint Designer 2007 with a border on the table, then you may have run into the problem of empty table cells loading without borders. This causes your table to look very strange in the browser. Well, here is a fairly simple work around to fix the problem. All you need to do is add a script block to the xslt in SharePoint Designer that will basically put a space inside all of the cells. Since this forces the cells to not be empty, they will all render with borders.
Here is the script block and some quick screenshots to demonstrate how it works.
Here is how the table will render without the script block if there are empty cells:
Add the script block inside of the td’s just after the xsl:value-of tags that contain the SharePoint field names that you have included in your DataFormWebPart:
Here is what the new page with blank cells should look like: