Tip#102: Did you know… How to specify tag specific formatting
Let’s see this with an example. I have the following html code on my page.
Now if I format the document by selecting Edit –> Format document (or Ctrl K, Ctrl D)
The document becomes
I want the content inside td should remain on the same line after formatting the document.
Following steps would show how you can specify tag specific formatting for the Visual Studio editor
Right click on the editor in an aspx file and select Formatting and Validation... (or alternatively you can go from Menu Tools-> Options -> Text Editor -> HTML -> Formatting)
From the options dialog select 'Tag specific options'
On the tag specific dialog you can select a tag or create new one and select various formatting options. For this example, I selected Client HTML Tags –> td and then set Line breaks as none and click Ok.
Now if I format the document, there are no line breaks added to the content of the td.
Hope this helps,
Deepak Verma
SDET | Visual Web Developer
Comments
Anonymous
March 25, 2010
Hi, is there a way to export those formatting options to share it across the team?Anonymous
May 11, 2010
The comment has been removed