You should open the settings.json file (shift+cmd+p for mac) and click on Open Preference: Open Settings (JSON)
add the following line at the beginning of the JSON file:
"html.format.wrapAttributes": "force-aligned",
In case formatting still does not work (this is a different issue), search for HTML and add the following lines
"[html]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Close and Open vscode then format by using (option+Shift+F)