Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap Responsive - Show Table Column only on Desktop

I'm using DataTables.net + Twitter Bootstrap and the responsive layout, what I'm trying is to hide some columns of the table using the class "visible-desktop" thats shows the columns only in big sizes but It seems not to work, hides well but if I resize the windows to get a desktop width the columns hidden start showing stacked, seems a CSS display class problem, because inherits the type of display from the parent:

.visible-desktop {
    display: inherit!important;
}

If I manipulate it to

.visible-desktop {
    display: table-cell!important;
}

works well... Is there a workaround for this? Or I have to write my own class for table column hiding?

like image 513
Santiago Avatar asked May 14 '13 14:05

Santiago


People also ask

How do you set the size of a column in a Bootstrap responsive table?

On the table you now need to enable flex box by adding the class d-flex , and drop the xs to allow bootstrap to automatically detect the viewport. Table column width use the same layout as grids do; using col-[viewport]-[size] . Remember the column sizes should total 12; 1 + 3 + 3 + 5 = 12 in this example.

What is Col S?

(law) Abbreviation of columns.

What is D grid in Bootstrap?

"D-" is kind of utilities for Bootstrap that effect on Display directly and help you to have Grid Layout. In Css we call that "Display".

How can you set the device width for mobile in Bootstrap?

With the help of media queries, Bootstrap gives different widths to the . container depending on the size of the device: Extra small devices (<768px): width: auto (or no width) Small Devices (≥768px): width: 750px.


3 Answers

Version 4

EDIT: Bootstrap 4 removed hidden and visible classes, see this answer for updated examples, and/or related official migration guide.

** Old Answer for Bootstrap 3 below **

Version 3

Available classes for .visible and .hidden.

Use a single or combination of the available classes for toggling content across viewport breakpoints.

bootstrap css html visible and hidden class grid

From Bootstrap section here http://getbootstrap.com/css/#responsive-utilities-classes

like image 197
DeBraid Avatar answered Oct 28 '22 04:10

DeBraid


I finally found that exists a workaround replacing:

visible-desktop

by

hidden-phone hidden-tablet

Hope helps someone!

like image 36
Santiago Avatar answered Oct 28 '22 03:10

Santiago


On Boostrap 3.0 use .visibilty-<size> or .hidden-<size> responsive classes as described in the official doc.

http://getbootstrap.com/css/#responsive-utilities-classes

like image 27
Joel AZEMAR Avatar answered Oct 28 '22 04:10

Joel AZEMAR