Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在asp.net mvc中对齐Web网格上的标题_Html_Asp.net_Css_Asp.net Mvc - Fatal编程技术网

Html 如何在asp.net mvc中对齐Web网格上的标题

Html 如何在asp.net mvc中对齐Web网格上的标题,html,asp.net,css,asp.net-mvc,Html,Asp.net,Css,Asp.net Mvc,我有九列的WEBGRID,在这里,我需要文本右对齐用于货币字段,而文本居中对齐用于其他字段。当我尝试对齐列时,其列已对齐,标题未正确对齐,如何根据列对齐方式对齐特定列的标题 <div id="gridContent"> @grid.GetHtml( tableStyle: "webgrid-table", headerStyle: "webgrid-header", footerStyle: "webgrid-footer", alt

我有九列的
WEBGRID
,在这里,我需要
文本右对齐
用于货币字段,而
文本居中对齐
用于其他字段。当我尝试对齐列时,其列已对齐,
标题未正确对齐,如何根据列对齐方式对齐特定
列的标题

<div id="gridContent">
     @grid.GetHtml(
     tableStyle: "webgrid-table",
     headerStyle: "webgrid-header",
     footerStyle: "webgrid-footer",
     alternatingRowStyle: "webgrid-alternating-row",
     selectedRowStyle: "webgrid-selected-row",
     rowStyle: "webgrid-row-style",
      columns: grid.Columns(
                            grid.Column("Cust_Name", "Customer Name", style:"Custname"),
                            grid.Column("SalesDatestr", "Sales Date",style: "name"),
                            grid.Column("TotalAmount", "Total Amount", style:"Curency"),
                            grid.Column("Pay_Amount", "Paid Amount", style:" width: 64px; text-align: right;  margin-right: 174px; border-right-style: solid; border-right-width: 29px; "),
                             grid.Column("Pay_Mode", "Paid Mode", style: "name"),
                             grid.Column("Bank_Name", "Bank Name", style: "name"),
                             grid.Column("Bank_Address", "Bank Address", style: "name"),
                             grid.Column("ChequeNo", "ChequeNo", style: "name"),
                             grid.Column("Cheque_Datestr", "Cheque Date", style: "name")                                                                             
                                    )
                                  )
</div>
纵队

.Curency
{
text-align: right;
width: 80px;
border: rgba(250, 38, 38, 0);
border-right-style: solid;
border-right-width: 10px;

}
应用此项:

<style type="text/css">
    tr.webgrid-row-style td:nth-child(4)
    {
        text-align: right;
    }
</style>

tr.webgrid-row-style td:n子项(4)
{
文本对齐:右对齐;
}
<style type="text/css">
    tr.webgrid-row-style td:nth-child(4)
    {
        text-align: right;
    }
</style>