Html formating and save function