Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make an unresponsive table?

I'm using Bootstrap 3 and I wanted to know how I can make an unresponsive table as it needs about 40 columns on screen.

My client doesn't mind if they have to horizontally scroll to view the table as long as all of the data is there.

So how do I make an unresponsive table where I set manually what the column widths are?

like image 968
Jamesking56 Avatar asked Jun 18 '14 08:06

Jamesking56


People also ask

How do I make a table responsive in CSS?

The primary method of making a responsive table is to add a class table table-responsive inside the table tag. To make a table responsive, we wrap the whole table inside a container tag like div with property overflow-x equals to auto .

How can I make my table height responsive?

The table will be responsive to changes in the table-layout property. You can make your container more responsive by using overflow-x:auto around the table> element in a container element (for example, div).

What is a responsive table?

A responsive table is a table that breaks down to one column while retaining its row/column structure on mobile devices. If you do not need to maintain the row/column structure, then you should probably use a grid.


3 Answers

You can set a min-width on the th columns. Here is an example:

http://jsbin.com/xuzuwuko/3/edit

like image 119
Charlie Avatar answered Oct 13 '22 13:10

Charlie


change the container class for "container-fluid"

Example:

<div class="container-fluid">
<table class="table">
...
</table>
</div>

for this work is necessary set doctype in html5:

<!DOCTYPE html>

and add to header this meta:

<meta name="viewport" content="width=device-width, initial-scale=1"> 

See documentation

like image 38
cbertelegni Avatar answered Oct 13 '22 14:10

cbertelegni


You can do this in a variety of ways:

1) set min-width in style-sheet to table, th, td, tr:

table {
    min-width:700px;
}
tr {
    min-width:120px;
}
th,td {
    min-width:20px;
}

2) Or, you can remove header responsive meta view:

<meta name="viewport" content="width=device-width, initial-scale=1">
like image 20
user3847516 Avatar answered Oct 13 '22 13:10

user3847516