When I use display: table-cell and white-space: normal , the red table is stretched and emptiness is formed in its right side. How to get rid of it? As an example, cited another code where the red table is not stretched.
It is necessary that the text be in one line, cut to the width of the block and ellipsis should be set at the end of the cutting of the text.
.ceneral_conteiner { background-color: grey; } .conteiner_right{ display: table-cell; width: 100%; max-width: 100%; background: red; } .conteiner_left{ display: table-cell; width: 0; } .con_item_left { display: inline-block; width: 30px; height: 90px; background: green; vertical-align: top; word-break: break-all; } <div class="ceneral_conteiner"> <div class="conteiner_left"> <div class="con_item_left"></div> </div> <div class="conteiner_right"> <div style="width: 50%; table-layout: fixed; overflow: hidden; text-overflow: clip; white-space: normal; display: block;"> <div style="height: 30px; width: 50%; display: block; background-color: blue; overflow: hidden; text-overflow: ellipsis; word-wrap: break-word; white-space: nowrap;"> нннннrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyнннннrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy </div> </div> </div> </div> In the second code, the text does not stretch the table.
.ceneral_conteiner { background-color: grey; } .conteiner_right{ display: table-cell; width: 100%; max-width: 100%; background: red; word-break: break-all; } .conteiner_left{ display: table-cell; width: 0; } .con_item_left { display: inline-block; width: 30px; height: 90px; background: green; vertical-align: top; word-break: break-all; } <div class="ceneral_conteiner"> <div class="conteiner_left"> <div class="con_item_left"></div> </div> <div class="conteiner_right"> 3333333333333333333334кккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккккцццццццццццццццццццццццццццццццццццццццццццццццццццццццццццккккккккккккккккккккккккккккккппппппппппппппппппппппппппппппппппппппппппп </div> </div>
Чем не устраивает второй код?- It is necessary that the text be in one line, cut to the width of the block and ellipsis set at the end of cutting the text. - Yury Svetlov