asp.net - 什么 HTML 容器用于 ASP 表单而不是 HTML 表

标签 asp.net html css

我需要知道将什么 HTML 容器用于 ASP 表单,以便可以使用 CSS 设置样式,而无需使用 HTML insead HTML 表格。

例如 aspx 页面上的这个表单:

<form id="WPF" runat="server">
<asp:Label ID="lblCCode" Text="Country Code" runat="server">
    <asp:TextBox ID="txtCCode" runat="server" Width="85"></asp:TextBox>
    </asp:Label>

<asp:Label ID="lblCName" Text="Country Name" runat="server">
    <asp:TextBox ID="txtCName" runat="server" Width="150"></asp:TextBox>
</asp:Label>

<asp:Label ID="lblCPop" Text="Country Population" runat="server">
    <asp:TextBox ID="txtCPop" runat="server" Width="130"></asp:TextBox>
</asp:Label>

最佳答案

使用 DIV 而不是 TABLE 是众所周知的,有很多东西可以找到。

例如http://www.html-cleaner.com/features/replace-html-table-tags-with-divs/

我不知道它是否会更简单,但您有更多选择。 但是,如果您的唯一目标是仅将 CSS 用于 TABLE 的样式,那么有关 TABLE 的所有内容都可以使用 CSS 进行陈旧。参见 here

关于asp.net - 什么 HTML 容器用于 ASP 表单而不是 HTML 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30442596/

相关文章:

c# - 划掉文字文本

html - Bootstrap - 导航栏旁边的大 Logo

html - 移动导航不是静态的

css 覆盖禁用文本选择

asp.net - 可以通过ASP.NET页面配置Quartz.NET日历吗?

c# - ASP.NET MVC 局部 View : How to fix "Error executing child request..." error?

javascript - 如何在没有 DIV 的情况下隐藏 <body>?

php - 滚动条出现在我的网站内

javascript - 如何使用 jQuery 动态更新 CSS 样式列表?

c# - 如何在 ServiceStack 中传输大型多千兆文件?