function htmlStr = ...
writeComparisionHtml(dir1, dir2, list1, list2, diff1, diff2, details)
% function htmlStr =
% writeComparisionHtml(dir1, dir2, list1, list2, diff1, diff2, details)
% Write the folder comparision results into an HTML table
% This function is working directly on the output of compareDirectoriesEngine
% Comparison title
htmlStr = sprintf('<h2> Comparing %s and %s</h2>\n', dir1, dir2);
% create the comparison table
htmlStr = sprintf('%s<table>\n', htmlStr);
len = length(list1);
htmlStr = sprintf('%s<tr>\n\t<td>%s</td>\n\t<td>%s</td>\n\t<td>%s</td>\n\t<td>%s</td>\n\t<td>%s</td>\n</tr>\n', ...
htmlStr, '<b>Diff 1</b>', '<b>Diff 2</b>', '<b>File 1</b>', '<b>File 2</b>', '<b>Details</b>');
% create a row for each comparison line
for i=1:len
htmlStr = sprintf('%s<tr>\n\t<td>%s</td>\n\t<td>%s</td>\n\t<td>%s</td>\n\t<td>%s</td>\n\t<td>%s</td>\n</tr>\n', ...
htmlStr, diff1{i}, diff2{i}, list1{i}, list2{i}, details{i});
end
% close HTML table
htmlStr = sprintf('%s\n</table>\n<p>\n', htmlStr);