[英]how to give gridview first column left margin from gridview?
<asp:GridView ID="grdUploadedFiles" runat="server" AutoGenerateColumns="False" AllowPaging="True"
PageSize="7" DataKeyNames="ID" OnRowEditing="grdUploadedFiles_RowEditing" OnRowUpdating="grdUploadedFiles_RowUpdating"
OnRowCancelingEdit="grdUploadedFiles_RowCancelingEdit" OnRowDeleting="grdUploadedFiles_RowDeleting"
ShowFooter="True" ForeColor="Black" GridLines="Vertical"
Width="439px" BackColor="White" BorderColor="#999999" BorderStyle="Solid"
Font-Size="Small" Font-Names="Arial" CellPadding="3" BorderWidth="1px">
<Columns>
<asp:TemplateField HeaderText="Type" HeaderStyle-HorizontalAlign="Center" >
<ItemTemplate>
<asp:Label ID="lblType" runat="server" Text='<%# Bind("FileType") %>'></asp:Label>
</ItemTemplate>
<asp:CommandField ShowEditButton="True">
<ItemStyle/>
</asp:CommandField></column></gridview>
我正在為我的 gridview 使用上面的代碼。我想為我的第一列添加填充。我還想在我的 gridview 中為我的編輯和刪除鏈接添加下划線。為此,如果我在編輯它時給出 textuderline='true"顯示更新刪除兩個看起來很難看的單個下划線。還有其他方法嗎?
I will suggest using CSS selectors for styling instead of using control properties (that generates inline styling that are difficult to maintain/change) - assuming you have applied css class "myGridView" to your grid view then use CSS such as
table.myGridView
{
color: black;
border: solid 1px #999999;
background-color: white;
width: 439px;
font-family: arial;
}
table.myGridView th
{
// style your column headings
}
table.myGridView td
{
// style your cells
padding: 3px;
}
table.myGridView tr td:first-child
{
// style the first cell in each row
padding-left: 10px;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.