Menu

tfoot above tbody

Pavel
2005-11-12
2012-10-09
  • Pavel

    Pavel - 2005-11-12

    I noticed that displaytag writes <tfoot> section after <thead> and before <tbody>. <br>
    Does anyone know if this by design or it will be changed?
    <br>
    If it stays like this, I can use it to insert an extra data filtering row above the <tbody>.

     
    • Pavel

      Pavel - 2005-11-13

      Thank you Jorge. This helps!
      I am looking for a good way to incert the list filter similar to one used in eXtremeComponents, but which can include select lists, different pickers, etc. If I understand it right, I can use a table decorator, which will have to be specific to each page. Instead it would be nice to have something like <display:toprow> similar to <display:foter>, which will allow me to specify filter contents in jsp.

      Using the fact that <tfoot> is written above <tbody> in html I can hack it producing malformed html, but achieving my goal:
      <display:footer>{footer text}</tfoot><tbody>{top row text}</tbody></display:footer>
      This will end up with extra end </tfoot> tag and two <tbody> bloks, which should still render just fine.

       
    • Jorge L. Barroso

      This a requirement of the HTML standard, which states that "TFOOT must appear before TBODY within a TABLE definition so that user agents can render the foot before receiving all of the (potentially numerous) rows of data."

      http://www.w3.org/TR/REC-html40/struct/tables.html#h-11.2.3

      Even though tfoot appears before tbody in the html, it's normally rendered after the table data. You might be able to have it display before the table data using css, or,
      to insert extra data above tbody, you could use the caption tag, or use a table decorator that inserts some rows after tbody but before the actual data rows.

      -Jorge

       

Log in to post a comment.

MongoDB Logo MongoDB