带有表格布局的表格:固定和调整大小 IE8 与 IE 7 / Chrome

发布于 2024-12-01 07:03:07 字数 536 浏览 6 评论 0原文

我正在 html 中制作时间线视图,但遇到了以下问题:

我有一个包含 12 个单元格的表格行,代表 12 个月,每个月都有一个根据该月天数的 colspan。在同一个表中还有另一行包含天数,因此它包含 365 个单元格。表格宽度为 100%,表格布局是固定的。当我在 Internet Explorer 8 中调整表格大小时,月份单元格的大小似乎均等地调整,但是当我在 Internet Explorer 7 或 Chrome 中调整大小时,调整大小从前几个月开始。这导致了几个月较短的错觉

我有一个屏幕截图来说明问题,您可以看到八月到一月的月份比其余月份要小:

Jsfiddle 示例: http://jsfiddle.net/GZtrx/

我有办法在不使用 Javascript 的情况下解决这个问题吗?

I'm making a timeline view in html but I ran into the following problem:

I've got a table row with 12 cells that represent 12 months, each of the month has a colspan according to the number of days in that month. In the same table there is another row containing days, so it contains 365 cells. The table has a width of 100% and the table layout is fixed. When I resize the table in Internet Explore 8 the month cells all seem to resize equally, however when I resize in Internet Explorer 7 or Chrome, the resizing starts at the first months. Which causes the illusion the months are shorter

I've a screenshot to illustrate the problem, you can see the months august till January are smaller then the rest:

Jsfiddle example: http://jsfiddle.net/GZtrx/

I there anyway to fix this without using Javascript?

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

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

发布评论

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

评论(2

尬尬 2024-12-08 07:03:07

您可以尝试这样的操作: JsFiddle 示例 它使用固定的 % 宽度而不是 colspan。

You could try something like this: JsFiddle example which uses a fixed % width instead of colspan.

老娘不死你永远是小三 2024-12-08 07:03:07

一些想法:

是否采用传统方法并使用透明的 1x1 px gif,并使用 .CSS 来设置 gif 宽度的样式?

作为单元格背景的透明 gif。

.CSS 中的最小宽度

A few thoughts:

How about going old school and using a transparent 1x1 px gif, and using .CSS to style the width of the gif?

Transparent gif as a cell bg.

min-width in the .CSS

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文