私は奇妙な状況にあり、テーブルがあり、すべての行に ajax フォームがあります。
Form
では許可されていませんが、tr
では許可されていtd
ます。そのため、すべての列を a 内に配置しtd
、手動でサイズを合わせる必要がありました。問題は、HtmlHelpers(ASP.Net MVC Razor) が追加するパディングとマージンにより、コンテンツが正しいヘッダー列の下に配置されないことです。
特定のクラス内で、すべてのアイテムのすべてのマージンとパディングを再帰的に取り除く css を作成する必要があります。どうやってやるの?
または、ヘッダーの下にコンテンツを強制的に配置する簡単な方法はありますか?
<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>