laciqodoti
New Member
I have a weird situation, I have a table, in every row I have an ajax form.\[code\]Form\[/code\] is not allowed in \[code\]tr\[/code\], but it's allowed in \[code\]td\[/code\]. So I had to place all column inside a \[code\]td\[/code\] and manually match the sizing. The problem is the padding and margin that HtmlHelpers(ASP.Net MVC Razor) add, cause the content not to be aligned under the correct header column.I need to write a css that gets rid of all margin and padding of all items recursively, inside a given class. How can I do that?Or is there an easier way to force align the content under the header?\[code\]<table style="width: 100%"> <thead> <tr> <th style="width: 5%">Id</th> <th style="width: 35%">Material</th> <th style="width: 60%">Description</th> </tr> </thead> <tbody> @foreach (var item in Model.items) { <tr> <td class="noMarginAndPadding" colspan="3"> @using (@Ajax.BeginForm()) { <span style="width: 5%">@Html.TextBoxFor(i => item.Id)</span> <span style="width: 35%">@Html.TextBoxFor(i => item.Name)</span> <span style="width: 60%">@Html.TextBoxFor(i => item.Description)</span> } </td> </tr> } </tbody><table>\[/code\]