Break Line On Each Tag Attribute And Keep Them Aligned In Visual Studio HTML Code Editor October 27, 2022 Post a Comment If you'd like to see this implemented in the next version of VS, please vote for it here. Suppose the following horizontally lengthy HTML declaration: Solution 1: Well, I found a trick at the ASP.NET Forums: Positioning each attribute on a separate line It's not like the XAML feature described in my question but it works. In Options/Text Editor/HTML/Format you can check "Wrap tags when exceeding specific length" and set the length to 1. That will cause the formatter to wrap like crazy. Another option is: Go to TOOLS => Options... => Text Editor => XML => Formatting => Align attributes each on a separate line. Close the .cshtml file. Right click it in Solution Explorer and select Open With... then select XML (text) Editor. Select all content and do Ctrl + K then Ctrl + F. * This second option is tedious! :( Solution 2: If you feel brave, you can write an editor extension that does this for you. Take a look at the align extension that Noah wrote a while ago for ideas: https://github.com/NoahRic/AlignAssignmentsBaca JugaWhat Does Font-size: 100% On The Html Element Do?Capturing Linebreaks (newline,linefeed) Characters In A TextareaHow To Avoid Spaces When Wrapping Markup Across Multiple Lines Solution 3: This has been implemented in the new HTML editor in Visual Studio 2013 Preview, which has been released. This is a feature of the new editor only, which works for html and cshtml files, but not for aspx/ascx files. If you hit [return] after each value, the attributes will stack up under the first attribute definition. Format Document will not undo these changes anymore. Solution 4: Copy the html to the xml editor let it format it for you, then save it back to the html file Solution 5: you can Find/Replace < with /n< + don't forget to click Use Regular Expressions setting Share You may like these postsHtml Formatting In RichtextboxDealing With Nested Quotes In Html Generated From C#What's The Difference Between And In Html?Rowspan Or Nested? Create A Table Itextsharp Post a Comment for "Break Line On Each Tag Attribute And Keep Them Aligned In Visual Studio HTML Code Editor"
Post a Comment for "Break Line On Each Tag Attribute And Keep Them Aligned In Visual Studio HTML Code Editor"