本文介绍了使用 <table> 是否有意义?贴上“现代"标签网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个现代"网站,但在使用 CSS 使所有内容正确排列时遇到了很多麻烦.我觉得如果我只使用表格,它们的布局会容易得多,但我一直在避免使用 <table> 标签,因为我被告知它们是老式的"而不是正确的做事方式.

I am developing a "modern" website, and I'm having a lot of trouble getting the CSS to make everything line up properly. I feel like they layout would be a lot easier if I just used a table, but I've been avoiding <table> tags, because I've been told that they are "old-fashioned" and not the right way to do things.

可以使用表格吗?我如何决定什么时候适合使用表格,什么时候应该使用 CSS?我只是做更容易的事情吗?

Is it okay to use tables? How do I decide when a table is appropriate, and when I should use CSS instead? Do I just do whatever is easier?

推荐答案

答案是肯定的,使用表格很好.一般的经验法则是,如果您要显示表格数据,表格可能是一个不错的选择.通常,您应该尽可能多地尝试使用 css 来设置表格的样式.

The answer is yes, it's fine to use tables. The general rule of thumb is that if you are displaying tabular data, a table is probably a good way to go. You should generally try to style your table with css as much as you can though.

此外,此饼图可能对您有所帮助:

Also, this pie graph might help you:

替代文字 http://www.ratemyeverything.net/image/7292/0/Time_Breakdown_of_Modern_Web_Design.ashx

编辑:表格很好.用于显示数据.就像我第二句话说的那样.问题是可以使用表格吗".答案是 - 是的,可以使用表格.这不违法.

EDIT: Tables are fine. For displaying data. Just like my second sentence stated. The question was "is it ok to use tables". The answer is - yes, it is ok to use tables. It is not illegal.

因为即使在我的一般经验法则中暗示使用表格作为数据,显然我还必须说明推论是将表格用于其他任何事情都是不行的,即使海报似乎已经掌握了这个概念.因此,作为记录,一般的经验法则是不要使用表格来布置您的网站.

Since even though it's implied to use tables for data in my general rule of thumb, apparently I must also state that the corollary is that it's not ok to use tables for anything else, even though the poster already seemed to grasp this concept. So, for the record, the general rule of thumb is to not use tables for laying out your site.

这篇关于使用 <table> 是否有意义?贴上“现代"标签网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 13:50