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

Puts an extra table with thead on the page #3

Open
jasonperrone opened this issue May 11, 2017 · 3 comments
Open

Puts an extra table with thead on the page #3

jasonperrone opened this issue May 11, 2017 · 3 comments

Comments

@jasonperrone
Copy link

jasonperrone commented May 11, 2017

Hi there. I'm looking at the code and it's pretty much doing on my page exactly what the code says and it doesn't seem right. I have a table with a thead, tbody and tfoot in it. The class of the table was set to jquery-thead. And as the code explicitly does in $.fn.thead, it clones that table with its thead into a new table and adds it to the page. Now I have this weird artifact underneath my table, which is in fact a new table with a new thead. I don't get it. Why does it do this? I need to get rid of this artifact on my page.

@jasonperrone
Copy link
Author

I see what is happening. You do set the new table to display: none, but I have it nestled in a container which does display. It would be easy to hide the cloned container if you put a class on it. The code says you are putting a class of cloned_thead on it, but it doesn't appear to be working. The container you added the table to does not in fact have that class.

@jasonperrone
Copy link
Author

jasonperrone commented May 11, 2017

I believe I see why the class is not there. Right after you add cloned_thead as a class on the new container, you then use the attr() method to set the new containers classes to the parent's classes, and this deletes the cloned_thead class you just added.

@jasonperrone
Copy link
Author

I fixed the problem by merely adding the cloned_thead class after you set the new container's classes to the parent's classes. Unfortunately, if in my css I set the cloned_thead to display: none, it breaks the plugin.

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

No branches or pull requests

1 participant