Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't handle nested tables #724

Closed
jon-freed opened this issue Sep 17, 2014 · 2 comments
Closed

Doesn't handle nested tables #724

jon-freed opened this issue Sep 17, 2014 · 2 comments

Comments

@jon-freed
Copy link

When a table with a sticky header has another table nested within it, then when you scroll down the second table's sticky header header is hidden. This is not optimal.

Ideally, the sticky portion would include multiple components. For a table with one nested table, it would have:

  1. The outer table's header
  2. The outer table's row that precedes the row with the nested table
  3. The nested table's header

Sample table HTML follows. (I'm Not sure, but I think that nested tables are handled through this pattern of pairs of TRs, with the second in each pair containing the nested table.)

Enabling stickiness on three rows like this might entail setting up a fixed div or something at the top of the page that could contain multiple headers. The height of the entire div and all of its contents would need to be measured.

Ideally, this would be able to handle nested tables ad infinitum, but being able to handle at least one nested table is a start. :)

By the way, I am impressed by this plugin. It is a lot more than a sorter that the name implies.

Sample table structure (for illustrative purposes; actual table would need a lot more rows in the parent table and the nested table to trigger the stickiness).

<table>
  <thead>
    <tr>
      <th>column header - stays in view while its table stays in view</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>header information for the table that is nested into the next row - should stay in view while the nested table stays in view</td>
    </tr>
    <tr>
      <td>
        <table>
          <thead>
            <tr>
              <th>header for the nested table - stays in view while the nested table stays in view</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>data in the nested table</td>
            </tr>
          </tbody>
        <table>
      </td>
    </tr>
  </tbody>
<table>
@Mottie
Copy link
Owner

Mottie commented Sep 17, 2014

Hi @jon-freed!

You're right, nested tables with sticky headers applied do not work properly. I'll fix this soon.

@Mottie
Copy link
Owner

Mottie commented Oct 20, 2014

In the working branch, I have an updated stickyHeaders and cssStickyHeaders widget that will now properly handle nested tables.

I am still having some issues with getting the cssStickyHeaders widget to work properly in IE (all versions). So, I wouldn't recommend using that widget for nested tables until I figure out that problem.

I hope to have the next update available in the master branch somewhere around this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants