<table class="data-table">
<tr>
<th style="width: 200px;">
DescriptionDescription <%--in this case <td> is resized--%>
</th>
</tr>
<% foreach (var item in Model) { %>
<tr>
<td style="width: 200px;">
<%= Html.Encode(item.Description) %>
</td>
</tr>
<% } %>
</table>
的大小瀏覽器的html:指定TD
<table class="data-table">
<tr>
<th style="width: 200px;">
Description
</th>
</tr>
<tr>
<td >
This is description
</td>
</tr>
</table>
爲什麼這個TD大小不是以查看網頁上應用?在VS 2008 TD尺寸設計視圖應用,但在我的瀏覽器上運行的項目後沒有指定大小
你能提供瀏覽器html嗎? – 2010-05-28 08:38:16
應該在某處還有一個右括號'}'?而不是aspx中的foreach循環,我會使用Repeater和ItemTemplate。 – 2010-05-28 08:55:38
好吧,我忘了寫在這裏 – Ognjen 2010-05-28 08:58:38