Tino Mclaren Tino Mclaren - 1 month ago 6
HTML Question

Line break after <td>?

I want to achieve this formatting in vs2010 inside table tag:

<tr>
<td><asp:TextBox ID="first_name" runat="server" /></td>
<td><asp:TextBox ID="last_name" runat="server" /></td>
</tr>


But VS 2010 does this :

<tr>
<td>
<asp:TextBox ID="first_name" runat="server" /></td>
<td>
<asp:TextBox ID="last_name" runat="server" /></td>
</tr>


I have tried Tools > Options > Text Editor > HTML > Formatting > Tag Pecific Options :
Default Setting > Client tag
& Default Setting > Client HTML Tags td
LineBreaks: None, Before & After, After etc... no option gives me what im after!

Before & After preview looks like what I want but it doesn't work when I hit ctrl+k+d!

If it turns out VS2010 wont do it, does anyone know of a tool that will?

Answer

I think you are on the right track with the method you were trying. However you also need to set the Line breaks for the asp:Textbox tag as well that is under Tools > Options > Text Editor > HTML > Formatting > Tag Pecific Options > ASP.NET controls. If you see asp:Textbox it probably has Line Breaks set to before and after as well.

Comments