{"action":"closed","issue":{"url":"https://api.github.com/repos/mkoryak/floatThead/issues/259","labels_url":"https://api.github.com/repos/mkoryak/floatThead/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/mkoryak/floatThead/issues/259/comments","events_url":"https://api.github.com/repos/mkoryak/floatThead/issues/259/events","html_url":"https://github.com/mkoryak/floatThead/issues/259","id":112207046,"number":259,"title":"floatThead on centered table","user":{"login":"MacGyver27","id":6546231,"avatar_url":"https://avatars.githubusercontent.com/u/6546231?v=3","gravatar_id":"","url":"https://api.github.com/users/MacGyver27","html_url":"https://github.com/MacGyver27","followers_url":"https://api.github.com/users/MacGyver27/followers","following_url":"https://api.github.com/users/MacGyver27/following{/other_user}","gists_url":"https://api.github.com/users/MacGyver27/gists{/gist_id}","starred_url":"https://api.github.com/users/MacGyver27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MacGyver27/subscriptions","organizations_url":"https://api.github.com/users/MacGyver27/orgs","repos_url":"https://api.github.com/users/MacGyver27/repos","events_url":"https://api.github.com/users/MacGyver27/events{/privacy}","received_events_url":"https://api.github.com/users/MacGyver27/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mkoryak/floatThead/labels/solved","name":"solved","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-10-19T18:43:08Z","updated_at":"2015-10-19T21:19:32Z","closed_at":"2015-10-19T21:19:32Z","body":"Hello,\r\n\r\nI have issue with using your floatthead plugin for table which is centered. I tried with obsolete align=\"center\" or table.center{margin-left:auto;margin-right:auto;} same buggy result.\r\n\r\nWas doing it 2 ways:\r\n1) using position: 'absolute', It will result into this: ![issue1](http://i62.tinypic.com/24orj0m.png)\r\n\r\n2) using position: 'fixed', this makes header to be re-rendered - for the short time 2 headers can be seen, one over other:\r\n![issue2](http://i62.tinypic.com/2zefi1w.png)\r\n\r\n\r\n    <div class=\"table-wrapper\">\r\n    \t<div class=\"table-responsive\">\r\n    \t\t<table float-thead=\"floatTheadOptions\" class=\"center table table-bordered table-striped\"\r\n    \t\t\t   style=\"white-space: nowrap; width: auto;\">\r\n    \t\t\t<thead >\r\n    \t\t\t<tr>\r\n    \t\t\t\t<th >Hostname</th>\r\n    \t\t\t\t<th >Hostname</th>\r\n    \t\t\t</tr>\r\n    \t\t\t</thead>\r\n    \t\t\t<tbody>\r\n    \t\t\t\t<tr ng-repeat=\"ne in networkElements\" >\r\n    \t\t\t\t\t<td>{{ ne.hostname }}</td>\r\n    \t\t\t\t\t<td>{{ ne.hostname }}</td>\r\n    \t\t\t\t</tr>\r\n    \t\t\t</tbody>\r\n    \t\t</table>\r\n    \t</div>\r\n    </div>\r\n\r\n    <script type=\"text/javascript\">\r\n        $(document).ready(function () {\r\n            var $table = $(\"table\");\r\n            $table.floatThead({\r\n                position: 'absolute' /////////////////////////////////////// OR 'fixed' in case 2)\r\n            });\r\n    \r\n            $table.floatThead('reflow');\r\n    \r\n            setTimeout(function () {\r\n                $table.floatThead('reflow');\r\n            }, 500);\r\n        });\r\n    </script>\r\n    <script type=\"text/javascript\">\r\n        $(function () {\r\n            var $table = $(\"table\");\r\n            $table.floatThead({\r\n                position: 'absolute', ////////////////////////////////////////// OR 'fixed' in case 2)\r\n                scrollContainer: function (tableTo) {\r\n                    return tableTo.closest(\".table-wrapper\");\r\n                }\r\n            });\r\n        });\r\n    </script>\r\n\r\nSo my question is, how to properly use floatThead with center alignment? I am trying to go with absolute position as it was recommended.\r\n\r\nAppreciate any input/concerns. Thanks a lot for great plugin. \r\n\r\nBTW I am not using script for floeatThead as shown,, I recreated it to do exactly what my implementation of angular directive for floatThead does for it.. [pastebin](http://pastebin.com/w0JxusA2)"}}