缩小单元格(在绝对定位的 ASP.NET 表中)以适应其内容?
我的网页目前如下所示:
<asp:Table runat="server" style="position: absolute;
left: 0%; top: 82%; right: 0%; bottom: 0%; width: 100%; height: 18%"
CellPadding="0" CellSpacing="0" GridLines="Both">
<asp:TableRow>
<asp:TableCell>
Content1
</asp:TableCell>
<asp:TableCell Width="2.5%">
</asp:TableCell>
<asp:TableCell >
Content2
</asp:TableCell>
</asp:TableRow>
</asp:Table>
http://img684。 imageshack.us/img684/9677/tableu.png
但我需要它看起来像这样:
http://img263.imageshack.us/img263/4508/table2k.png
“Content1”的大小未知,表格必须进行调整以适应它,但不会从“Content2”中占用任何不必要的空间。我不能使用“display: table”,因为 IE7 等不支持它,所以我几乎只能使用常规的表格元素,除非有更好的东西可以在旧版浏览器中支持。
有谁知道如何实现这一点?
My webpage currently looks like this:
<asp:Table runat="server" style="position: absolute;
left: 0%; top: 82%; right: 0%; bottom: 0%; width: 100%; height: 18%"
CellPadding="0" CellSpacing="0" GridLines="Both">
<asp:TableRow>
<asp:TableCell>
Content1
</asp:TableCell>
<asp:TableCell Width="2.5%">
</asp:TableCell>
<asp:TableCell >
Content2
</asp:TableCell>
</asp:TableRow>
</asp:Table>
http://img684.imageshack.us/img684/9677/tableu.png
But I need it to look like this:
http://img263.imageshack.us/img263/4508/table2k.png
"Content1" is of unknown size, and the table will have to adjust to fit it in, but without taking any unnecessary space away from "Content2." I can't use "display: table" because it isn't supported in IE7 and such, so I'm pretty much stuck using a regular table element unless there is something better out there that is supported in older browsers.
Does anyone know how this can be accomplished?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不为 Content2 单元格添加宽度?像这样的东西:
Why not add a width to the Content2 cell? Something like: