我可以将一个HTML表格标题放在两个表格列上吗?像Excel中的合并和中心? [英] Can I have one HTML table header be over two table columns? Like merge and center in Excel?

查看:157
本文介绍了我可以将一个HTML表格标题放在两个表格列上吗?像Excel中的合并和中心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将一个表头并排放在两个表格列中间。这可能吗?

< / p>< / code>< / p>

推断了一点......

 <表> 
< thead>
< tr>
< th>单列< / th>
< th colspan =2>双列< / th>
< / tr>
< / thead>
< tbody>
< tr>
< td>第一列< / td>
< td>第二栏< / td>
< td>第三栏< / td>
< / tr>
< / tbody>
< / table>

这应该足以让您工作。


I want to have one table header be centered over two table columns side by side. Is this possible?

解决方案

<th colspan="2">. This .</th>

To extrapolate a bit...

<table>
  <thead>
    <tr>
      <th>Single Column</th>
      <th colspan="2">Double Column</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Column One</td>
      <td>Column Two</td>
      <td>Column Three</td>
    </tr>
  </tbody>
</table>

That should give you enough to work from.

这篇关于我可以将一个HTML表格标题放在两个表格列上吗?像Excel中的合并和中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆