1. In the edit column, you can directly set the column width! If you don't want the cell content to increase the size of the cell, add a style.
<Style> table {table-layout: fixed} </style>, which means that each column is fixed to the style originally set and does not change. The excess part is hidden.
2. You can set the attribute <HeaderStyle Width = "8%"> </HeaderStyle> of a column under the editing column in The gridview to display the display by of the screen.
3. You must have set the height attribute of the gridview. In this way, you have fixed the height of the gridview. If the data is insufficient, the height of the gridview will not change, you can delete the height attribute of the gridview. If the layout is affected, you can
Add the following code to the RowDataBound data of the gridview:
E. Row. Attributes. Add ("style", "height: 43px"); To set the Row height
The automatically generated GridView cannot modify the column width. You can set it using ItemStyle.
<Asp: GridView ID = "GridView1" runat = "server" AutoGenerateColumns = "False">
<Columns>
<Asp: BoundField DataField = "id">
<ItemStyle Width = "100px"/>
</Asp: BoundField>
</Columns>
</Asp: GridView>
4. 1. Set the Width and Height of the column in GridView> Columns> HeaderStyle, GridView> Columns> ItemStyle> Height and Width.