There is a table:
<table> <tr><td>АРБУЗ ---------</td><td>СЕМЕЧКИ</td></tr> <tr><td>БОЛЬШОЙ АРБУЗ -</td><td>СЕМЕЧКИ</td></tr> </table>
How to make a line depending on the length of the content?
Or on the tables this can not be done?
There is a table:
<table> <tr><td>АРБУЗ ---------</td><td>СЕМЕЧКИ</td></tr> <tr><td>БОЛЬШОЙ АРБУЗ -</td><td>СЕМЕЧКИ</td></tr> </table>
How to make a line depending on the length of the content?
Or on the tables this can not be done?
See this option
td:first-child { white-space: nowrap; overflow: hidden; } td:first-child:after { display: inline-block; width: 100%; content: ''; border-bottom: 1px dashed #999; }
That this table is not a problem at all. In the cell of the table, you can always put a div and stretch it over the cell. The key question here is, do you have a uniform background under the text? If so, make the line a background, and “Big Watermelon” wrap it in an inline block and seal the same background as the one under the table. If not, then in the cell you need to make a two-column layout, where the left column takes the width "by contents", and the right one all the rest. Well, in the right, respectively, the background. Pay attention to possible line breaks. Perhaps they need to gash white-space: nowrap;
Source: https://ru.stackoverflow.com/questions/397126/
All Articles