Answers for "force table to fit to page css"

CSS
0

force table to fit to page css

table { 
    table-layout:fixed;
}

td { 
    overflow: hidden; 
    text-overflow: ellipsis; 
    word-wrap: break-word;
}

/*For mobile phones I leave the table width but assign an additional CSS
class to the table to enable horizontal scrolling (table will not go over
the mobile screen anymore):*/

@media only screen and (max-width: 480px) {
    /* horizontal scrollbar for tables if mobile screen */
    .tablemobile {
        overflow-x: auto;
        display: block;
    }
}
Posted by: Guest on September-30-2020

Code answers related to "force table to fit to page css"

Browse Popular Code Answers by Language