你如何在HTML表格中使用colspan和rowspan? [英] How do you use colspan and rowspan in HTML tables?

查看:225
本文介绍了你如何在HTML表格中使用colspan和rowspan?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何合并HTML表格中的行和列。


您可以帮我制作HTML格式的表吗?

解决方案

我会建议:

  table {empty-cells:show; border:1px solid#000;} table td,table th {min-width:2em;最小高度:2em; border:1px solid#000;}  

< table> < THEAD> < TR> < th rowspan =2>< / th> < th colspan =4>& nbsp;< / th> < / TR> < TR> <的第i; I< /第> <的第i; II蛋白酶/第> <的第i; III< /第> <的第i; IIII< /第> < / TR> < / THEAD> < TBODY> < TR> < TD>< / TD> < TD→1< / TD> < TD> 2'; / TD> < TD> 3'; / TD> < TD> 4℃; / TD> < / TR> < / tbody>< / table>

$ b

参考文献:




I don't know how to merge rows and columns inside HTML tables.

Can you please help me with making such a table in HTML?

解决方案

I'd suggest:

table {
    empty-cells: show;
    border: 1px solid #000;
}

table td,
table th {
    min-width: 2em;
    min-height: 2em;
    border: 1px solid #000;
}

<table>
    <thead>
        <tr>
            <th rowspan="2"></th>
            <th colspan="4">&nbsp;</th>
        </tr>
        <tr>
            <th>I</th>
            <th>II</th>
            <th>III</th>
            <th>IIII</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td></td>
            <td>1</td>
            <td>2</td>
            <td>3</td>
            <td>4</td>
         </tr>
    </tbody>
</table>

References:

这篇关于你如何在HTML表格中使用colspan和rowspan?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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