用于优雅css降级的HTML / CSS设计规划

时间:2022-11-27 08:13:37

On the front page of my personal website I have a listing of all the articles and the date they were published. This data would be a perfect use for an HTML table tag. The table would only be used to display the tabular data.

在我的个人网站的首页上,我列出了所有文章及其发布日期。这些数据非常适合HTML表格标签。该表仅用于显示表格数据。

I worked on it again, and was able to achieve the same layout using unordered lists and a little bit of css.

我再次研究它,并且能够使用无序列表和一点点css实现相同的布局。

So now I got two versions, both look the same (ie and ff). I want the page to degrade as gracefully as possible.

所以现在我有两个版本,两个看起来都一样(即和ff)。我希望页面尽可能优雅地降级。

I view the tabled page without the stylesheets, and everything degrades nicely. When I degrade the table-less page, it looks ok.

我查看没有样式表的表格页面,一切都很好地降级。当我降低无表格页面时,它看起来没问题。

But clearly the tabled page degrades more nicely.

但显然,表格页面会更好地降级。

also, in lynx, the tabled version looks a lot better then the table-less version.

另外,在lynx中,tabled版本看起来比无表格版本要好得多。

Are tables justified in this case?

在这种情况下,表格是否合理?

Should I go with the table-less layout now that I have one? or is the table better for degradation purposes?

我现在应该使用无表格布局吗?或表更好地用于降解目的?

4 个解决方案

#1


It's no big deal, if you want them to degrade to tables, use tables. This whole no-tables-deal is about proper semantics, not avoiding them altogether.

如果你想让它们降级到表,使用表格,这没什么大不了的。这整个没有表格的交易是关于正确的语义,而不是完全避免它们。

If you consider your data to belong in a table put it in one.

如果您认为您的数据属于表格,则将其放在一个表格中。

But do expect me to come after you with a pitchfork if you use tables for formatting ;)

但是如果你使用表格进行格式化,请指望我用干草叉来跟你一起;)

#2


If the data is a table, then use a table. That's what they are meant for.

如果数据是表,则使用表。这就是他们的意思。

The whole "no tables" thing is more about avoiding tables for purposes other than showing tables e.g. the whole layout of a page.

整个“无表格”的事情更多的是为了避免表格而不是显示表格,例如页面的整个布局。

#3


Html tables are for .. tables of data, the css point is just not to use them for layout of the site, its fine (and expected) to use tables to display tabled data.

Html表用于..数据表,css点只是不使用它们进行网站布局,其精细(和预期)使用表来显示表格数据。

#4


As it has been mentioned already, tables are not inherently evil, but bad form and reminiscent of the Good Old Web(r) when it was the only way to accomplish some fancy formatting.

正如已经提到的那样,表格本身并不是邪恶的,但是形式不好并且让人想起Good Old Web(r),这是完成某些花哨格式化的唯一方法。

Nowadays non-CSS capable browsers are almost statistical noise.

如今不支持CSS的浏览器几乎都是统计噪声。

The only reason to use and to avoid going the CSS way is outlined in twiki.org (taken originally from wikipedia)

使用和避免使用CSS方式的唯一原因在twiki.org中概述(最初来自*)

Even when the availability of CSS capable browsers made CSS a viable technology, the adoption of CSS was still held back by designers' struggles with browsers' incorrect CSS implementation and patchy CSS support. Even today, these problems continue to make the business of CSS design more complex and costly than it should be, and cross-browser testing remains a necessity. Other reasons for continuing non-adoption of CSS are:

即使具有CSS功能的浏览器的可用性使CSS成为一种可行的技术,设计人员在浏览器错误的CSS实现和不完整的CSS支持方面的努力仍然阻碍了CSS的采用。即便在今天,这些问题仍然使CSS设计业务变得更加复杂和昂贵,并且跨浏览器测试仍然是必需的。继续不采用CSS的其他原因是:

  • its complexity,
  • inertia and authors' lack of familiarity with CSS and required techniques,
  • 惯性和作者缺乏对CSS和所需技术的熟悉,

  • poor support from authoring tools,
  • 创作工具的支持不足,

  • the risks posed by inconsistency between browsers and the increased costs of testing,
  • 浏览器之间的不一致和测试成本增加带来的风险,

  • and less frequently a requirement to deliver consistent appearance even to users of ancient non-CSS-capable browsers.
  • 并且不太经常需要为古老的非CSS浏览器的用户提供一致的外观。

Most, if not all, of this points are already a thing of the past. Nowadays, it's strengths far out win it's perceived problems.

大多数(如果不是全部)这些观点已经成为过去。如今,它的优势远远超过了它所认识到的问题。

Unless you are expecting a lot of links & friends to be browsing your site expecting to see a table based layout -which I personally don't, and I use links quite a lot ;)-, then go with tables.

除非你期望很多链接和朋友浏览你的网站,希望看到一个基于表格的布局 - 我个人没有,我使用很多链接;) - 然后去表格。

#1


It's no big deal, if you want them to degrade to tables, use tables. This whole no-tables-deal is about proper semantics, not avoiding them altogether.

如果你想让它们降级到表,使用表格,这没什么大不了的。这整个没有表格的交易是关于正确的语义,而不是完全避免它们。

If you consider your data to belong in a table put it in one.

如果您认为您的数据属于表格,则将其放在一个表格中。

But do expect me to come after you with a pitchfork if you use tables for formatting ;)

但是如果你使用表格进行格式化,请指望我用干草叉来跟你一起;)

#2


If the data is a table, then use a table. That's what they are meant for.

如果数据是表,则使用表。这就是他们的意思。

The whole "no tables" thing is more about avoiding tables for purposes other than showing tables e.g. the whole layout of a page.

整个“无表格”的事情更多的是为了避免表格而不是显示表格,例如页面的整个布局。

#3


Html tables are for .. tables of data, the css point is just not to use them for layout of the site, its fine (and expected) to use tables to display tabled data.

Html表用于..数据表,css点只是不使用它们进行网站布局,其精细(和预期)使用表来显示表格数据。

#4


As it has been mentioned already, tables are not inherently evil, but bad form and reminiscent of the Good Old Web(r) when it was the only way to accomplish some fancy formatting.

正如已经提到的那样,表格本身并不是邪恶的,但是形式不好并且让人想起Good Old Web(r),这是完成某些花哨格式化的唯一方法。

Nowadays non-CSS capable browsers are almost statistical noise.

如今不支持CSS的浏览器几乎都是统计噪声。

The only reason to use and to avoid going the CSS way is outlined in twiki.org (taken originally from wikipedia)

使用和避免使用CSS方式的唯一原因在twiki.org中概述(最初来自*)

Even when the availability of CSS capable browsers made CSS a viable technology, the adoption of CSS was still held back by designers' struggles with browsers' incorrect CSS implementation and patchy CSS support. Even today, these problems continue to make the business of CSS design more complex and costly than it should be, and cross-browser testing remains a necessity. Other reasons for continuing non-adoption of CSS are:

即使具有CSS功能的浏览器的可用性使CSS成为一种可行的技术,设计人员在浏览器错误的CSS实现和不完整的CSS支持方面的努力仍然阻碍了CSS的采用。即便在今天,这些问题仍然使CSS设计业务变得更加复杂和昂贵,并且跨浏览器测试仍然是必需的。继续不采用CSS的其他原因是:

  • its complexity,
  • inertia and authors' lack of familiarity with CSS and required techniques,
  • 惯性和作者缺乏对CSS和所需技术的熟悉,

  • poor support from authoring tools,
  • 创作工具的支持不足,

  • the risks posed by inconsistency between browsers and the increased costs of testing,
  • 浏览器之间的不一致和测试成本增加带来的风险,

  • and less frequently a requirement to deliver consistent appearance even to users of ancient non-CSS-capable browsers.
  • 并且不太经常需要为古老的非CSS浏览器的用户提供一致的外观。

Most, if not all, of this points are already a thing of the past. Nowadays, it's strengths far out win it's perceived problems.

大多数(如果不是全部)这些观点已经成为过去。如今,它的优势远远超过了它所认识到的问题。

Unless you are expecting a lot of links & friends to be browsing your site expecting to see a table based layout -which I personally don't, and I use links quite a lot ;)-, then go with tables.

除非你期望很多链接和朋友浏览你的网站,希望看到一个基于表格的布局 - 我个人没有,我使用很多链接;) - 然后去表格。