display:table,在列 thead 上添加另一个 thead

display:table, add another thead over column thead

我正在使用 display:table 查看 jsp 页面上的一些报告数据。我想用它来利用显示 table 标签的 csv/excel 导出。我需要在列 header 上添加另一个列名称 header,逻辑上连接它下面的列。这是一个例子:

           +--------------------------------------------+
           |            File               ||   Record  |
           +--------------------------------------------+
+-------------------------------------------------------+
| Sort id ||Col1  ||  col2  || ...  || Coln||col1||coln |
+------------------------------------+------------------+

我尝试使用带有以下代码的 display:caption 作为第一个 object 显示 table 节点:

<display:caption>
    <tr class="header">
        <th style="background: white" colspan="1"></th>
        <th class="header" colspan="8">File</th>
        <th class="header" colspan="1">Record</th>
    </tr>   
</display:caption>

它添加了列,但是在列名下 thead :( :

+-------------------------------------------------------+
| Sort id  |Col1  ||  col2  || ...   | Coln||col1||coln |
+------------------------------------+------------------+
           +--------------------------------------------+
           |            File               ||   Record  |
           +--------------------------------------------+

有人知道是否可以注入由显示 table 标签自动生成的 thead 代码 html 插入 thead 代码,或以其他方式插入列行名称上的一行 header?

我找到了解决办法。在显示标题中添加我想要包含在 thead 节点中的 header,它会在列显示 thead:

上添加
<display:caption>
  **<thead>**    
    <tr class="header">
        <th style="background: white" colspan="1"></th>
        <th class="header" colspan="8">File</th>
        <th class="header" colspan="1">Record</th>
    </tr>
  **</thead>**
</display:caption>

我不喜欢这个解决方案,但它确实有效!