cssを使用してグリッドビューを垂直に揃えようとしていますが、データフィールドが平行ではなくヘッダーフィールドの下にあるという問題があります。asp:gridview header cssを使用した垂直方向の整列
HEADER1::DATA FIELD1
HEADER2:DATA FIELD2
HEADER3:私は必要なもの
があり、DATA FIELD3
しかし、私が得ることである。
HEADER1
HEADER2
HEADER3
DATA FIELD1
DATA FIELD2
データフィールド3
画像を見て分かりやすくしてください。
私はそれを修正する助けてください。
CSS:
.ChildGrid td{
background-color: #eee !important;
color: black;
font-size: 10pt;
line-height:200%;
}
.ChildGrid th{
background-color: #6C6C6C !important;
color: White;
font-size: 10pt;
line-height:200%;
}
table.ChildGrid, table.ChildGrid tr, table.ChildGrid td, table.ChildGrid th{
display:block
}
HTML:
<asp:GridView ID="gvSDate2" runat="server" AutoGenerateColumns="false" CssClass="ChildGrid">
<Columns>
<asp:TemplateField ItemStyle-Width="150px" HeaderText="ID">
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Text='<%#Eval("ID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="150px" HeaderText="நிகழ்ச்சி">
<ItemTemplate>
<asp:TextBox ID="textFunction" runat="server" Text='<%#Eval("Function") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="150px" HeaderText="நிகழ்ச்சி தேதி">
<ItemTemplate>
<asp:TextBox ID="textFunctionDate" runat="server" Text='<%#Eval("FunctionDate") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Gridviewで 'HeaderStyle-CssClass'を使用し、CSSクラスを追加して整列させてみましょう同じ行 – Webruster
ok私はcssクラスを追加しました。正確なCSSコードを使ってデータフィールドと整列させることができますか? – prkash
データの1行のみ? – naveen