force table to fit to page css

Solutions on MaxInterview for force table to fit to page css by the best coders in the world

showing results for - "force table to fit to page css"
Giovanni
16 Aug 2017
1table { 
2    table-layout:fixed;
3}
4
5td { 
6    overflow: hidden; 
7    text-overflow: ellipsis; 
8    word-wrap: break-word;
9}
10
11/*For mobile phones I leave the table width but assign an additional CSS
12class to the table to enable horizontal scrolling (table will not go over
13the mobile screen anymore):*/
14
15@media only screen and (max-width: 480px) {
16    /* horizontal scrollbar for tables if mobile screen */
17    .tablemobile {
18        overflow-x: auto;
19        display: block;
20    }
21}