HTML often encountered in order to put a table header part of the frozen, so that the better experience when browsing, Baidu finished most of the online solutions, advanced Bootstrap and Angularjs no clear solution, Do we Chinese need to fix the table head or freeze the table head? Actually write one also have nothing to do, eacherp in there is a very convenient solution, a function just, use up more convenient.
JavaScript code:
<script>var container= "#grid", var url= "abc.php", var table_title= "serial number, production ticket, dispatch No., date, material id"; var height= "400px"; var hidden_cols= "currency_id,warehouse,supplier_id"; cjtable (Container,url,table_title,height,hidden_cols); Table height, need to hide the td</script>
which
Container: Is the ID of the container that contains the table,
URL: Provides the source URL for tabular data, which is in JSON format
Table_title: The text of the table header
Height: Table Heights
Hidden_cols: Which JSON fields do not need to be displayed
users can freely download this JS file, you can directly use it to build a fixed header HTML table. :http://www.eacherp.net The rightgrid.js file after downloading and see the cjtable function.
This article is from the "11027040" blog, please be sure to keep this source http://11037040.blog.51cto.com/11027040/1759021
jquery fixed header or frozen header method