asp.net 的奇怪问题... tabpanel/Gridview 移出表格区域

发布于 2024-10-19 17:18:34 字数 846 浏览 15 评论 0原文

我的项目面临一个奇怪的问题...当页面渲染时,我的 tabpanel/gridview 移出了表格区域。简而言之:我已经在表格内声明了一个选项卡面板,例如

<table id="table1" border="1" runat="server" width="100%">
<tr><td>
<cc1:tabcontainer .....>
<cc1: tabpanel .......>
<gridview .............>
</gridview>
</cc1:tabpanel>
</cc1:tabcontainer>
</td></tr>
<table> 

当页面呈现时...我的选项卡面板显示超出表格区域...意味着它一半在表格内,一半在表格外。

我认为问题可能出在 tabpanel 上...我删除了面板并将 GridView 保留在表格内,如下所示

<table id="table1" border="1" runat="server" width="100%">
<tr><td>
<gridview .............>
</gridview>
</td></tr>
<table> 

但我仍然面临同样的问题。 Gridview 渲染正在移出表格宽度。我尝试更改表格宽度和 Gridview 宽度,但没有成功。

这甚至不是 CSS 设计的问题...因为其他页面中的 Gridview 工作正常。

请帮我解决这个问题。

I am facing a strange issue with my project ... when page is rendering my tabpanel/gridview is moving out of table area. To brief: I have declared a tabpanel inside table like

<table id="table1" border="1" runat="server" width="100%">
<tr><td>
<cc1:tabcontainer .....>
<cc1: tabpanel .......>
<gridview .............>
</gridview>
</cc1:tabpanel>
</cc1:tabcontainer>
</td></tr>
<table> 

When page renders ... my tabpanel display going out of table area ... means it's half inside table and half outside table.

I thought maybe the problem is with tabpanel ... I removed the panel and just kept GridView inside table like below

<table id="table1" border="1" runat="server" width="100%">
<tr><td>
<gridview .............>
</gridview>
</td></tr>
<table> 

But still I am facing the same issue. Gridview rendering is moving out of the table width. I tried changing the table width and Gridview width but no luck.

It's even not the problem with CSS design ... cause Gridview in other pages are working fine.

Please help me to solve this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等风来 2024-10-26 17:18:34

这很可能是渲染控件 html 代码中 div 的 CSS 问题。

顺便说一句,代码看起来有点像 html 表格的“布局滥用”——确定仅用 CSS 无法实现相同的效果吗?

但是,如果您想保留该表并解决问题,请尝试以下操作:

  1. 将传送到浏览器的 html 代码复制到您最喜欢的文本编辑器(确保使用生成的代码,如有必要,请使用 Web-Developer- Firefox 的工具栏插件)
  2. 使用静态 html(更改代码,保存并在浏览器中打开)并通过删除所有不是原因的内容来缩小行为原因,这样最终您就得到了表格和 - 正如我怀疑的 - 一个“移出表格宽度”的 div 层

It's most likely a CSS issue with a div in the rendered control html code.

BTW, the code looks a bit like a "use for layout abuse" of an html table - sure you can't achieve the same with just CSS?

However, if you want to keep the table and solve the issue, try the following:

  1. Copy the html code that gets delivered to the browser to your favorite text editor (make sure you use the generated code, if necessary use the Web-Developer-Toolbar add-on for Firefox)
  2. Play around with the static html (change code, save and open in browser) and narrow down to the reason for the behavior by removing everything that is NOT the reason, so that in the end you just have the table and - as I suspect - a div layer that "moves out of the table width"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文