additional header <tr> and summarized values in <tfood>
See original GitHub issueHi Andrew,
In my target table, I use a seperate <tr>
inside the header (above the column description) to specify a factor for the SUM values later in the <tfoot>
tag.
- Is there a way to specify an additional
<tr>
tag inside the header as coded below? - how do I specify a
<tfood>
tag that summarises the values of the tables for each column, using also the “factor” given from the header<input>
field?
would like to get a result something like this:
<table>
<thead>
<tr>
<th>factor SUM</th>
<th><input type="number" name="factor_savings" value=2></th>
</tr>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$360</td>
</tr>
</tfoot>
</table>
thanks Michael
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Tables in HTML documents
Table cells may either contain "header" information (see the TH element) or "data" (see the TD element). Cells may span multiple rows and...
Read more ><tfoot>: The Table Foot element - HTML - MDN Web Docs
The HTML element defines a set of rows summarizing the columns of the table. ... Permitted content, Zero or more <tr> elements.
Read more >Types of Therapeutic Diets
A therapeutic diet is a meal plan that controls the intake of certain foods or nutrients. It is part of the treatment of...
Read more >Dietary Guidelines for Americans | health.gov
The Dietary Guidelines for Americans (Dietary Guidelines) provides advice on what to eat and drink to meet nutrient needs, promote health, and prevent ......
Read more ><table rules=""> » - HTML
7 Values of the rules Attribute; 8 All Attributes of table Element ... RULES and FRAME have an annoying way of changing each...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Both of these are possible, but you have to do much of the work yourself - they aren’t built into flask table.
Firstly, the extra th:
Something like:
Secondly, the tfoot:
Hopefully, you should be able to run those and work out what is going on. For both, I poked into the code for the
Table
class in https://github.com/plumdog/flask_table/blob/master/flask_table/table.py and have overridden the relevant methods. (The current state of the code doesn’t make this sort of thing super easy, but it is possible).Also, you should be able to use those two together without a problem (though I haven’t actually tested it!)
Hope that’s useful!
@plumdog Thank yuo for the footer implementation! I’ve re-used it today in my project to work with DataTables, to filter columns with multiple values (where a footer like that is required in fact)