简体   繁体   English

C#ASP.NET Webform中的不同表类型

[英]Different table type in C# ASP.NET webform

I am trying to add a table to my web form. 我正在尝试将表格添加到我的Web表单。 When I try to set the properties of the table's cell to display in solution explorer, I don't see the Valign Property mentioned in my book exercise. 当我尝试设置要在解决方案资源管理器中显示的表格单元格的属性时,我在书本练习中没有看到Valign Property I see properties that start with "aria". 我看到以“ aria”开头的属性。 Am I using the wrong type of table? 我使用的表格类型错误吗?

Someone please guide me. 有人请指导我。

valign is not valid HTML5, it's been deprecated. valign是无效的HTML5,已弃用。 Use CSS instead and use the 改用CSS并使用

vertical-align:alignment (top, bottom, middle)

instead. 代替。

The HTML way: HTML方式:

<table>
   <tr>
      <td style="vertical-align:middle;">Vertically centered text</td>
      <td style="vertical-align:top;">Vertically top aligned text</td>
   </tr>
</table>

The ASP.NET WebForms way: ASP.NET WebForms的方式:

<asp:Table id="myTable" runat="server">
    <asp:TableRow>
        <asp:TableCell VerticalAlign="Middle">
            Vertically centered text
        </asp:TableCell>
        <asp:TableCell VerticalAlign="Top">
            Vertically top aligned text
        </asp:TableCell>
    </asp:TableRow>
</asp:Table>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM