how to create a Responsive table Thank You for your feedback. The Javascript shown below is used to initialise the table shown in this example: $(document).ready(function() { var table = $('#example').DataTable( { responsive: true } ); new $.fn.dataTable.FixedHeader( table ); } ); In addition to the above code, the following Javascript library files are loaded for use in this example: Or, pick a maximum breakpoint with which to have a responsive table up to by using .table-responsive {-sm|-md|-lg|-xl|-xxl} . The point is to notice the HTML---you will recognize some elements! Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. Examples might be simplified to improve reading and learning. A single row of data needs to be kept together to make any sense in a table. Every developer needs clean and modern elements to develop their websites, It contains pictures and a user interface element within a website. A responsive table will display a horizontal scroll bar if the screen is too small to display the full content: Add a container element (like
) with overflow-x:auto around the
element to make it responsive: The condensed table creates a table with half the padding of the simple table cell. . A gallery is one of the main components of a website, It contains links to the other sections and a user interface element within a website. Make any table responsive across all viewports by wrapping a .table with .table-responsive. If you have or manage a lot of data, but do not have a proper way to represent it, then it … In web design tables are created with 'table' tag. Required fields are marked *. Responsive tables. The .table-responsive class creates a responsive table. Best online HTML code editor, helps you to write and test run your HTML code online from your browser. Your email address will not be published. When viewing on anything larger than 768px wide, there is no difference: Example ... W3Schools is Powered by W3.CSS This will make your table scrollable (horizontally) and hence fits your table in small devices also. tag. Tables, dropdown menus, panels, and dividers, oh my!.