954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Visual Studio Reformatting HTML

I am using Visual Studio 2010 and I am trying to enter some HTML by hand. I code the following lines:

<tr>
   <td colspan="4" class="shade tableheader">NCR Information </td>
</tr>
<tr>
   <td class="shade">Date Opened </td>
   <td><asp:TextBox ID="fldReportDate" runat="server" CssClass="datePicker"></asp:TextBox> </td>
   <td class="shade">NCR # </td>
   <td style="font-weight: bold; font-size: 12pt"><asp:Label ID="fldLog" runat="server"></asp:Label></td>
</tr>
<tr>
   <td class="shade">Closed Date </td>
   <td><asp:TextBox ID="fldClosedDate" runat="server" CssClass="datePicker"></asp:TextBox></td>
   <td align="left" class="shade">NCR Type* </td>
   <td align="left"><asp:DropDownList ID="fldNCRType" runat="server" CssClass="required"></asp:DropDownList></td>
</tr>


I save the document and it converts my code to:

<tr>
   <td colspan="4" class="shade tableheader">NCR Information </td></tr><tr>
   <td class="shade">Date Opened </td><td>
       <asp:TextBox ID="fldReportDate" runat="server" CssClass="datePicker"></asp:TextBox></td><td class="shade">NCR # </td><td style="font-weight: bold; font-size: 12pt">
        <asp:Label ID="fldLog" runat="server"></asp:Label></td></tr><tr>
   <td class="shade">Closed Date </td><td>
        <asp:TextBox ID="fldClosedDate" runat="server" CssClass="datePicker"></asp:TextBox></td><td align="left" class="shade">NCR Type* </td><td align="left">
         <asp:DropDownList ID="fldNCRType" runat="server" CssClass="required">
         </asp:DropDownList>
   </td>
</tr>


I then reformat the code, using the Visual Studio Reformat command, and I get:

<tr>
  <td colspan="4" class="shade tableheader">NCR Information </td>
</tr>
<tr>
  <td class="shade">Date Opened </td>
  <td><asp:TextBox ID="fldReportDate" runat="server" CssClass="datePicker"></asp:TextBox></td>
  <td class="shade">NCR # </td>
  <td style="font-weight: bold; font-size: 12pt"><asp:Label ID="fldLog" runat="server"></asp:Label></td>
</tr>
<tr>
  <td class="shade">Closed Date </td>
  <td><asp:TextBox ID="fldClosedDate" runat="server" CssClass="datePicker"></asp:TextBox></td>
  <td align="left" class="shade">NCR Type* </td>
  <td align="left">
    <asp:DropDownList ID="fldNCRType" runat="server" CssClass="required"></asp:DropDownList>
  </td>
</tr>


When I manually format I get what is seen in the last code example (I am not worried about the extra returns as I can take care of this using tag formatting options.), but why, when I save does it pulls everything back together. I have 's and 's mingling on the same same line, it is insanity.

I have looked at this blog entr y and have put spaces all over my document before each tag, after each tag/element and it does not seem to help. Am I reading something wrong?

svilla
Junior Poster in Training
88 posts since Aug 2010
Reputation Points: 27
Solved Threads: 27
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: