how to give padding to <td>
from aspx.cs page
i want to give set
style="position: absolute; t开发者_StackOverflow社区op: 0; right: 0px; left: 173px; height: 32px; width: 50px;"
this from aspx.cs
page
If I understand you right you should:
Add ID attribute to your <td> tag (for example ID="myControl")
Add runat="server" attribute to your <td> tag.
<td ID="myControl" runat="server"></td>
Write following code in your aspx.cs file:
myControl.Attributes.Add("style", "position: absolute; top: 0; right: 0px; left: 173px; height: 32px; width: 50px;");
<td>
is a static HTML element, I think you have to use that style for DIV
or SPAN
<table>
<tr>
<td>
<div id="div1" runat="server">
</div>
</td>
</tr>
</table>
in aspx.cs
div1.Attributes.Add("style", "position: absolute; top: 0; right: 0px; left: 173px; height: 32px; width: 50px;");
精彩评论