I'm facing an issue that needs to be resolved.
Currently, I have a group of div elements arranged in a table-like structure with a row and three columns.
When these divs reach a maximum width of 768px, the first column is hidden, leaving only the second and third columns visible with an input text field. The input text should also include a label displayed inline.
The problem arises when the input's text extends outside the confines of the table, despite having a CSS width of 100%.
Below is the snippet of code:
/* DivTable.com */ * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .divTable{ display: table; width: 100%; } .divTableRow { display: table-row; } .divTableHeading { background-color: #EEE; display: table-header-group; } .divTableCell, .divTableHead { border: 1px solid #999999; display: table-cell; padding: 3px 10px; } .divTableHeading { background-color: #EEE; display: table-header-group; font-weight: bold; } .divTableFoot { background-color: #EEE; display: table-footer-group; font-weight: bold; } .divTableBody { display: table-row-group; } .form-control { width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075); box-shadow: inset 0 1px 1px rgba(0,0,0,.075); -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; } @media (max-width: 768px) { .hide1 { display:none; } .force-display { display:block; } .forcew { white-space:nowrap; }
For the full code and demonstration, please refer to this fiddle link: https://jsfiddle.net/bt6hrc4h/