Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用HTML5元素的表格格式页面?_Html_Html Table_Html Email_Semantics - Fatal编程技术网

使用HTML5元素的表格格式页面?

使用HTML5元素的表格格式页面?,html,html-table,html-email,semantics,Html,Html Table,Html Email,Semantics,我可以使用HTML5元素在使用表格进行格式化的“页面”上概述代码吗?例如: <section id="posts"> <tr id="posts-title-row"> <header><td id="posts-title"> <h2>Latest Posts</h2> </td></header> </tr> <tr id="posts-r

我可以使用HTML5元素在使用表格进行格式化的“页面”上概述代码吗?例如:

<section id="posts">
  <tr id="posts-title-row">
    <header><td id="posts-title">
      <h2>Latest Posts</h2>
    </td></header>
  </tr>
  <tr id="posts-row">
    <article><td>
      <p>Maecenas faucibus mollis interdum.</p>
    </td></article>
    <article><td>
      <p>Maecenas faucibus mollis interdum.</p>
    </td></article>
    <article><td>
      <p>Maecenas faucibus mollis interdum.</p>
    </td></article>
  </tr>
</section>

最新帖子
梅塞纳斯·福西布斯·莫利斯·因特杜姆

梅塞纳斯·福西布斯·莫利斯·因特杜姆

梅塞纳斯·福西布斯·莫利斯·因特杜姆


总的来说,我知道这是一种非常糟糕的形式,但在电子邮件客户端(特别是Gmail)支持电子邮件的CSS3格式之前,除了使用表格来格式化HTML电子邮件(例如新闻稿)之外,几乎没有其他选择。然而,为了让我自己在语义上安心,我想使用
类型元素来组织事情。

可以,但是元素放错了位置。它们需要位于
s内。您还需要将整个表包装在


最新帖子

梅塞纳斯·福西布斯·莫利斯·因特杜姆。

梅塞纳斯·福西布斯·莫利斯·因特杜姆。

梅塞纳斯·福西布斯·莫利斯·因特杜姆。


好吧,只要您的电子邮件服务接受HTML5标记,您就可以将其与表格格式一起使用。但是,您可以尝试使用CSS(注意,我没有提到CSS3)为页面提供样式。永远记住内联样式

2013年使用表格格式就像坐马车去上班一样,但说到电子邮件服务,仍然是镇上的治安官


祝你好运

如果您关心的是语义,您可以在现有元素上使用为
定义的:

<table id="posts" aria-role="region">
    <tr id="posts-title-row">
        <td id="posts-title" aria-role="banner">
            <h2>Latest Posts</h2>
        </td>
    </tr>
    <tr id="posts-row">
        <td aria-role="article">
            <p>
                Maecenas faucibus mollis interdum.
            </p>
        </td>
        <td aria-role="article">
            <p>
                Maecenas faucibus mollis interdum.
            </p>
        </td>
        <td aria-role="article">
            <p>
                Maecenas faucibus mollis interdum.
            </p>
        </td>
    </tr>
</table>

最新帖子

梅塞纳斯·福西布斯·莫利斯·因特杜姆。

梅塞纳斯·福西布斯·莫利斯·因特杜姆。

梅塞纳斯·福西布斯·莫利斯·因特杜姆。


是的,表格更大,我有标签,但我只复制粘贴了一大块。这是最好的方法。电子邮件与常用标记(如spans、DIV和p)不一致。如果您试图强制语义标记工作,那将是自找麻烦。
<table id="posts" aria-role="region">
    <tr id="posts-title-row">
        <td id="posts-title" aria-role="banner">
            <h2>Latest Posts</h2>
        </td>
    </tr>
    <tr id="posts-row">
        <td aria-role="article">
            <p>
                Maecenas faucibus mollis interdum.
            </p>
        </td>
        <td aria-role="article">
            <p>
                Maecenas faucibus mollis interdum.
            </p>
        </td>
        <td aria-role="article">
            <p>
                Maecenas faucibus mollis interdum.
            </p>
        </td>
    </tr>
</table>