GridView thead、tbody、tfoot 渲染顺序
有没有办法控制 GridView 控件渲染其 thead
、tbody
和 tfoot
子元素的顺序?
根据 W3C,正确的顺序是:
- thead
- tfoot
- tbody
GridView 控件渲染出:
- thead
- tbody
- tfoot
我正在扩展 GridView 控件,并且我正在使用 “第一列控制所有列的宽度” 方法。 但如果不满足 W3C 规范(thead
-> tfoot
-> tbody
),一切都会崩溃。
我一直在阅读这个问题,似乎 GridView 控件尚不支持这一点——不过这是计划好的。 即使是这样; 我敢打赌一定有某种方法来对抗这种粗略的实施。
任何和所有的帮助表示赞赏。
Is there any way to control the order of which the GridView control renders it's thead
, tbody
and tfoot
child elements?
According to W3C, the correct order is:
- thead
- tfoot
- tbody
The GridView control renders out:
- thead
- tbody
- tfoot
I am extending the GridView control, and I'm using the "first column controls the width of all columns" approach. But if the W3C specifications are not met (thead
-> tfoot
-> tbody
) all hell breaks loose.
I've been reading up on this issue, and it seems that the GridView control has no support for this yet--it's planned though. Even so; I bet there must be some way to counter this sketchy implementation.
Any and all help apreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您需要对您的 HTML 进行严格的 W3C 验证(您必须有正当理由),您最好不要使用 ASP.net 服务器控件,因为您对它们生成的 HTML 没有任何控制权。
我敢打赌,这个小问题只是您稍后会发现的问题的冰山一角。
If you need strict W3C Validation of your HTML (you must have a valid reason), you better not use ASP.net server controls, because you don't have any control on the HTML they generate.
I bet that this little problem is just the tip of the iceberg of the problems that you will find later.
我想任何由 Microsoft 类生成的 HTML 都 100% 肯定会破坏验证并且只能在其 Internet Explorer 上使用。
编写您自己的实现 - 或者找到一些可以正确处理它的开源类。
I would imagine that any HTML generated by a Microsoft class will 100% definitely break validation and only work with it's Internet Explorer.
Write your own implementation - or find some Open Source class that will take care of it properly.
这还不可能。 尽管微软计划在未来的版本中提供此功能。
This is not yet possible. Although Microsoft is planning this feature for a future release.