-1

I am working on a simple application that displays a table based on selected features and companies a user wants to compare. I am using Bootstrap 3 but because of the way my code works, I cannot use DataTables. I want the table header to float, and I have tried quite a few methods to get this to work. This includes JavaScript/JQuery/CSS solutions on the table header and JS/CSS solutions on tbody scrolling.

One problem is that my code destroys and rebuilds the table every time a user changes their selections. I am pretty new to Web development and this is the only thing so far that has really given me issues. I would really appreciate any help! Thanks in advance!

Link to working version: http://www.buyvm.theoks.net/b-rant/EHR_Tool/EHR_Form.php

  • Show us your code before you get down voted. – ODelibalta Sep 04 '15 at 19:02
  • What exactly would you like to see? It is all in the page, you can see it by viewing source. – Brant DenHerder Sep 04 '15 at 19:04
  • Thank captain. What you linked is a working version. Why would I want to see that ? Even if I look at the source, how will I know the difference between your code and actually say "hey this is where you are wrong" ... I am (was) interested in the problem aka your code. – ODelibalta Sep 04 '15 at 19:07
  • This does not have a floating table header implemented yet, I am asking if people have ideas to help me get a working floating header or scrolling tbody. – Brant DenHerder Sep 04 '15 at 19:10
  • Everything I have tried so far has not worked for various reasons. – Brant DenHerder Sep 04 '15 at 19:12

1 Answers1

1

Floating headers / scrolling tbody is just not viable in HTML right now. It seems the best you can do is have two tables: the first for the headers, and the second for the body wrapped in a <div style=overflow: auto;></div> and hope the columns line up.

<table><tbody> scrollable?

How can I let a table's body scroll but keep its head fixed in place?

Community
  • 1
  • 1
travis.js
  • 5,193
  • 1
  • 24
  • 21