On 2024-10-19 02:08 +05:30, Dr. Volker Zell wrote:
But back to the main question ... is it somehow possible to generate the <tfoot> footer elements ...<table id="example" class="cell-border hover compact" width="100%"> <thead> <tr> <th>Name</th> <th>Position</th> <th>Office</th> </tr> </thead> <tbody> <tr> <td>Tiger Nixon</td> <td>System Architect</td> <td>Edinburgh</td> </tr> <tr> <td>Ashton Cox</td> <td>Technical Author</td> <td>San Francisco</td> </tr> </tbody> <tfoot> <tr> <th>Name</th> <th>Position</th> <th>Office</th> </tr></tfoot> </table>
The Org mode HTML exporter does not seem to provide any facility for using table footers. You can use the export-filter mechanism of Org mode to add the footer, but in this case it is simpler to use the columns.footer option of DataTables, as in the following sample. #+title: Org Tables to DataTables #+html_doctype: html5 #+html_head: <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> #+html_head: <script src="https://cdn.datatables.net/2.1.8/js/dataTables.min.js"></script> #+html_head: <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.min.css" /> #+html_head:<script>$(document).ready(function () {$('#example').DataTable({columns: [{footer: 'Name'}, {footer: 'Position'}, {footer: 'Office'}]});});</script> #+html_head: <script>$(document).ready(function () {$('#another-example').DataTable({lengthMenu: [3, {label: 'All', value: -1}]});});</script> This is an example table. #+attr_html: :id example :class cell-border hover compact :width 100% | Name | Position | Office | |-------------+------------------+---------------| | Tiger Nixon | System Architect | Edinburgh | | Ashton Cox | Technical Author | San Francisco | ------------------------------------------------------------ This is another example table. #+attr_html: :id another-example :class display | Author | Title | Shelf | |-------------------+-------------------------+-------| | Capote, Truman | In cold blood | D3B | | Chandler, Raymond | The high window | D3B | | Dai, Mamang | The legends of Pensam | D3B | | Desai, Kiran | The inheritance of loss | D3B | | Farrell, J. G. | The hill station | C1B |
