Fill available spaces between labels with dots or hyphens

后端 未结 6 618
栀梦
栀梦 2020-11-30 04:46

I have a page with labels which are contained in a div, the labels has a variable with and i want to fill spaces between both with characters, dots or \'-\'.

For ex

6条回答
  •  生来不讨喜
    2020-11-30 05:24

    I have implemented this on a table with pure CSS and even without using any span or div.

    CSS is:

    .dot-table td {
        max-width:200px;
        overflow:hidden;
        white-space:nowrap;
    }
    .dot-table td:first-child:after {
        content:" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
    }
    

    HTML is

    Coffee 45 INR
    Tea 36 INR

    A detailed output (from a site I developed) A detailed table with filling dots

    View it live here.

提交回复
热议问题