【发布时间】:2017-04-27 08:13:01
【问题描述】:
我已经尝试过将 gridview 包裹起来
<div style="overflow-x:auto;width:800px"></div>
但它不起作用。
无论我做什么,我最终都会得到这个。 滚动条存在但我的gridview 的列宽没有根据宽度增加。像注释部分应该更大。
我在后面的代码中绑定了gridview。 这是我的 aspx 代码:
<fieldset id="fs1" class="labels" runat="server" style="border: solid; border-width: thin; width: 98%; height: auto; border-color: #a8a8a8;">
<div style="overflow-x: auto; width: 1100px">
<asp:GridView ID="gvReport" runat="server" AutoGenerateColumns="false" Width="100%"
CssClass="Grid" Style="font-size: 10pt; font-family: Calibri;"
AlternatingRowStyle-CssClass="alt"
OnPreRender="gvReport_PreRender"
OnPageIndexChanging="gvReport_PageIndexChanging"
PagerStyle-CssClass="pgr">
</asp:GridView>
</div>
<div id="div13" style="margin-top: 10px; margin-bottom: 10px; margin-left: 10px;">
<asp:Table runat="server">
<asp:TableRow>
<asp:TableCell>
<asp:Button CssClass="buttons___" Width="160" ID="btnXcel" Text="Download Excel" OnClick="btnXcel_Click" runat="server" />
<asp:Button CssClass="buttons___" Width="160" ID="btnCSV" Text="Download CSV" OnClick="btnCSV_Click" runat="server" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</fieldset>
【问题讨论】:
标签: c# html css asp.net gridview