我的报告中有一个gridview,但是如果我设置最小高度和宽度但我想设置,我的网格css会扭曲,因为我想根据我的主div自动调整gridview,即网格应该根据主div或屏幕进行相应的拉伸和数据单元也因此合并,所以我应该怎么做
<div class="dvmain">
<table>
<tr>
<td>
<div style="width:100%; overflow:auto;min-height:500px;">
<asp:GridView ID="GridView1" runat="server" width:auto Height:auto
AutoGenerateColumns="False" ShowFooter="True" CssClass="Itemgrid"
RowStyle-CssClass="RowStyle"
onrowdatabound="GridView1_RowDataBound" onrowcreated="GridView1_RowCreated">
<Columns>
<asp:BoundField DataField="itdsrno" HeaderText="Srno" />
<asp:BoundField DataField="itemname" HeaderText="Item" />
<asp:BoundField DataField="itdlength" HeaderText="Gsm" />
<asp:TemplateField HeaderText="Qty">
<FooterTemplate>
<asp:Label ID="lbltotalquan" runat="server" Text="Label"></asp:Label>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblquantity" runat="server" Text='<%# Eval("itdquan")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="unitname" HeaderText="Nos" />
<asp:BoundField DataField="mstexcDes" HeaderText="Grain" />
<asp:TemplateField HeaderText="Rate">
<FooterTemplate>
<asp:Label ID="Label2" runat="server" Text="INR"></asp:Label>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
String.Format("{0:f2}",DataBinder.Eval(Container.DataItem,"itdRate")) %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Amount">
<FooterTemplate>
<asp:Label ID="lbltxttotal" runat="server" />
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblamount" runat="server" Text='<%#
String.Format("{0:f2}",DataBinder.Eval(Container.DataItem,"itdAmou")) %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="itdrema" HeaderText="Remark" />
</Columns>
</asp:GridView>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
css
<style type="text/css">
.style1
{
min-width:200px;
}
div.title
{
font-family:Verdana;
font-size:14px;
}
.style2
{
}
.dvitems
{
font-family:Verdana;
font-size:12px;
width: 108px;
}
.dvpo
{
font-family:Verdana;
font-size:12px;
width: 70px;
height: 22px;
}
.dvinstruction
{
font-family:Verdana;
font-size:12px;
margin-left:20px;
}
.dvterms
{
font-family:Verdana;
font-size:12px;
margin-left:10px;
}
.style4
{
height: 18px;
}
.style6
{
}
div.dvmain
{
border-width:1px;
border-style:solid;
border-color:#000000;
margin-left:80px;
margin-top:50px;
width:80%
min-height:650px;
font-family:Verdana;
}
.grd
{
font-family:Verdana;
min-height:400px;
position:relative;
}
.grd td
{
text-align:center;
border: solid 1px #000000;
}
/* div.dvtitle
{
border-width:1px;
border-style:solid;
border-color:#000000;
}*/
div.dvright
{
/* border-width:1px;
border-style:solid;
border-color:#000000; */
}
div.dvleft
{
border-width:1px;
border-style:solid;
border-color:#000000;
}
.tbborder
{
border:1px solid black;
border-right-style:none;
border-left-style:none;
}
table.tbpayterms
{
border-left-style:none;
border-width: 0 0 1px 1px;
border-spacing: 0;
border-style: solid;
}
.tbpayterms td
{
margin: 0;
padding: 4px;
border-width: 1px 1px 0 0;
border-style: solid;
}
.body
{
font-family:Verdana;
}
.verticalLine {
border-right:thick solid #000000;
height:auto;
border-width:1px;
}
.dvfaith
{
width: 138px;
}
.dvthanks
{
width: 117px;
}
.style14
{
width: 319px;
height: 22px;
}
.style15
{
height: 22px;
}
.style17
{
width: 159px;
}
.style39
{
width: 219px;
}
.style40
{
width: 103px;
}
.style41
{
width: 102px;
}
.style42
{
width: 249px;
}
.style43
{
width: 185px;
}
.style58
{
}
.style61
{
width: 69px;
}
.style63
{
width: 340px;
}
.style64
{
width: 273px;
}
.style67
{
width: 73px;
}
.style68
{
width: 87px;
}
.style69
{
width: 528px;
}
.style70
{
width: 112px;
}
@media print {
input#btnPrint {
display: none;
}
input#btnback {
display: none;
}
}
</style>