Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Responsive table handling in Twitter Bootstrap

When a table's width exceed the span's width, like this page: http://jsfiddle.net/rcHdC/

You will see the table's content is outside of the span.

What would be the best method to cater this case?

like image 587
Ryan Avatar asked Mar 02 '13 16:03

Ryan


People also ask

Is twitter bootstrap responsive?

With Bootstrap 2, we've gone fully responsive. Our components are scaled according to a range of resolutions and devices to provide a consistent experience, no matter what.

Which Bootstrap 4 class can be used to make a borderless table?

<code>. table-borderless</code> class for a table without borders.

Which class can be used to create a responsive table?

To create a responsive table with Bootstrap, use the table-responsive class.


2 Answers

Bootstrap 3 now has Responsive tables out of the box. Hooray! :)

You can check it here: https://getbootstrap.com/docs/3.3/css/#tables-responsive

Add a <div class="table-responsive"> surrounding your table and you should be good to go:

<div class="table-responsive">   <table class="table">     ...   </table> </div> 

To make it work on all layouts you can do this:

.table-responsive {     overflow-x: auto; } 
like image 145
Leniel Maccaferri Avatar answered Oct 04 '22 06:10

Leniel Maccaferri


One option that is available is fooTable. Works great on a Responsive website and allows you to set multiple breakpoints... fooTable Link

like image 44
Gfw Avatar answered Oct 04 '22 05:10

Gfw