html - HTML中的嵌套colspan
问题描述
我正在尝试制作一个简单的表格。我能够进行第一次调用。但第二个不工作。表在下图中。
下面是我尝试过的html代码:
<table class="table table-bordered" width="100%" border="1" cellpadding="3" cellspacing="0">
<thead>
<tr class="bg-dark text-white" align="center">
<th rowspan="2" class="text-center">{{ __('Major Technology Adopted') }}</th>
<th colspan="10" class="text-center">{{ __('No Of Farmers Adopted Technology:Since Inception To Date') }}</th>
</tr>
<tr class="bg-dark text-white" align="center">
<th colspan="4" class="text-center">{{ __('CIG') }}</th>
<th colspan="4">{{ __('Non-CIG') }}</th>
</tr>
<tr>
<th class="text-center">{{ __('Total Farmer') }}</th>
<th class="text-center">{{ __('Female Farmers') }}</th>
<th class="text-center">{{ __('Total Ethnic') }}</th>
<th class="text-center">{{ __('Female Ethnic') }}</th>
<th class="text-center">{{ __('Total Farmer') }}</th>
<th class="text-center">{{ __('Female Farmers') }}</th>
<th class="text-center">{{ __('Total Ethnic') }}</th>
<th class="text-center">{{ __('Female Ethnic') }}</th>
</tr>
</thead>
</table>
我怎样才能做到这一点?
解决方案
<table class="table table-bordered" width="100%" border="1" cellpadding="3" cellspacing="0">
<thead>
<tr class="bg-dark text-white" align="center">
<th rowspan="2" class="text-center">{{ __('Major Technology Adopted') }}</th>
<th colspan="10" class="text-center">{{ __('No Of Farmers Adopted Technology:Since Inception To Date') }}</th>
</tr>
<tr class="bg-dark text-white" align="center">
<th colspan="4" class="text-center">{{ __('CIG') }}</th>
<th colspan="4">{{ __('Non-CIG') }}</th>
</tr>
<tr>
<th></th>
<th class="text-center">{{ __('Total Farmer') }}</th>
<th class="text-center">{{ __('Female Farmers') }}</th>
<th class="text-center">{{ __('Total Ethnic') }}</th>
<th class="text-center">{{ __('Female Ethnic') }}</th>
<th class="text-center">{{ __('Total Farmer') }}</th>
<th class="text-center">{{ __('Female Farmers') }}</th>
<th class="text-center">{{ __('Total Ethnic') }}</th>
<th class="text-center">{{ __('Female Ethnic') }}</th>
</tr>
</thead>
</table>
推荐阅读
- ios - 如何在圆形进度条上添加多个圆圈?
- java - 从 listView Firebase 中删除项目
- javascript - 如何接收从 python 烧瓶到 JavaScript 的变量?
- javascript - 在数据呈现中实现两个条件
- javascript - Postman - 测试以匹配嵌套对象中的对象数量
- file - 如何在 Clojure 中动态创建文件资源?
- python - 我应该如何将自定义记录器从文件传递到多个模块并同时保持子模块粒度?
- excel - vba 运行时错误 1004,尝试使用 for 循环在一系列单元格上输入公式
- php - 在数组wordpress自定义字段术语中获取重复的术语名称?
- javascript - Express-sessions 不在不同路由上保存会话数据