I generated HTML code from Photoshop, but items are not aligning correctly when I use this code to create a template.
Photoshop is a great tool for slicing and optimizing images. However the table it generates from your slices in HTML code may not be "clean" enough to be used as a basis for an HTML email. The code generated by Photoshop simply consists of a table with graphics in various cells.
Dreamweaver is another product in the Adobe Creative Suite family that can be used to clean up the HTML code.
Using Dreamweaver in design mode, you can review the layout and identify graphic spacers that were inserted and remove them. The spacers are often inserted when there are areas of white space around your slices.
There may also be unused rows and columns in the HTML table that will need to be removed, including the rows or the columns in the table that held the graphic spacers (which will also need to be deleted). This is because they would create areas of white space in the HTML email.