本文介绍了如果您正在用 HTML 编写日历,您会使用 Table 标签还是 Div 标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我公司的日历转换为 XSL,并将所有表格更改为 div.它工作得很好,但由于不稳定的跨浏览器间距问题,我最初有很多每周 8 天的错误需要解决.但我正在阅读另一篇关于何时使用表格与 div 的文章,共识似乎是您应该只将 div 用于网页各部分之间的真正划分,并且仅将表格用于表格数据.

I converted my company's calendar to XSL and changed all the tables to divs. It worked pretty well, but I had a lot of 8 day week bugs to work out initially owing to precarious cross-browser spacing issues. But I was reading another post regarding when to use tables v. divs and the consensus seemed to be that you should only use divs for true divisions between parts of the webpage, and only use tables for tabular data.

我不确定我什至可以将表格与 XSL 一起使用,但我想继续讨论 Div 和表格,讨论制作网络日历的理想方法,也许是两者的结合.

I'm not sure I could even have used tables with XSL but I wanted to follow up that discussion of Divs and Tables with a discussion of the ideal way to make a web calendars and maybe a union of the two.

推荐答案

日历是使用表格的最佳理由!日历固有地呈现表格数据,而 HTML 表格擅长呈现表格数据.HTML 表格标记提供了几乎所有的 CSS 钩子,您需要将 CSS 选择器与表格的各个部分相关联,以修饰它.

A calendar is the perfect reason to use a table! Calendars inherently present tabular data and HTML tables are good at presenting tabular data. And HTML table markup provides nearly all the CSS hooks you need to associate CSS selectors with various parts of the table to dress it up.

我完全赞成使用 DIV 进行布局——但对于表格数据坚持使用表格.

I'm all for using DIVs for layout--but stick with tables for tabular data.

这是一篇关于如何用 CSS 修饰表格的很酷的文章:http://www.smashingmagazine.com/2008/08/13/top-10-css-table-designs

Here is a cool article on how to dress up tables with CSS:http://www.smashingmagazine.com/2008/08/13/top-10-css-table-designs

这篇关于如果您正在用 HTML 编写日历,您会使用 Table 标签还是 Div 标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 16:44