Place automatically generated icons next to each other in javascript/HTML

Asked

Viewed 132 times

0

I would like you to be on each other’s side. Every time the customer uploads a contract he stays horizontal. I would like to be vertical.

inserir a descrição da imagem aqui

Follows the code:

var txt = "";

if (json.code == 1) {
   $(json.data).each(function () {  
       txt += '<div class="center" id="link-Contrato">'
       txt += '<a class="link-pop-up red" href="#" data-url="' + this.urlcontrato + '" data-width="10px"><i style="font-size: 24pt;" class="fa fa-file-pdf-o"></i></a><br>';
       txt += '    <span><a class="link-pop-up" target="_blank" href="' + this.urlcontrato + '">Contrato</a></span><br><br>'
       txt += '    <span><strong>' + this.tipo_contrato + '</strong></span><br>'

       if (this.detalhamento == "") {
          txt += ''
       } else {
          txt += '    <span><strong>' + this.detalhamento + '</strong></span><br>'
       }
       txt += '    <span><strong>' + this.data_upload + '</strong></span><br>'
       txt += '</div></div><br>'
   });

   } else {
       txt += '<span>Nenhum histórico encontrado.</span>';
   }
   $('#link-Contrato').html(txt);
},
  • 2

    tried to use display: inline-block for example?

  • Using CSS: div.nomedoicone { float: left; } replacing the "div.nomedoicone" with the class surrounding the icon, container, or list you use to display the files

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.