When exporting a result set of the Wikidata Query Service as HTML table (via Download -> HTML Table), the WDQS doesn't put HTML table cell elements (i.e. <td></td> tags) in the table row, when the cells are empty. This doesn't matter when columns with optional values are on the right side of the table, but when they are on the left or in the middle, the cells are not properly aligned in the columns anymore.
Example: The common example query of cats in wikidata, extended by the optional property of IMDB-ID, but in this case the IMDB-ID (which only 6 of the 128 cats have) is the left most column. When downloading the data as HTML table, the result renders like this:
Most of the rows are misaligned because the IMDB-ID is missing. Only in the cases where there is an IMDB-ID does the content of the row correspond to the table header.
Solution: the WDQS should create empty table cells (<td></td> tags) when there is no content for the corresponding result and not just ignore the current cell.