jquery - How to display li items horizontally with same spacing and align neatly -


i have li items how display horizontally or format neatly

below html

<!doctype html> <html lang="en" ng-app="app">  <head> <meta charset="utf-8"> <script     src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js"></script> <script src="script.js"></script>  <!-- latest compiled , minified css --> <link rel="stylesheet"     href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"     integrity="sha384-bvyiisifek1dgmjrakycuhahrg32omucww7on3rydg4va+pmstsz/k68vbdejh4u"     crossorigin="anonymous">  <!-- optional theme --> <link rel="stylesheet"     href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"     integrity="sha384-rhyon1irsvxv4nd0jutlngaslcjuc7uwjduw9svrlvryoopp2bwygmgjqixwl/sp"     crossorigin="anonymous">  <!-- latest compiled , minified javascript --> <script     src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"     integrity="sha384-tc5iqib027qvyjsmfhjomalkfuwvxzxupncja7l2mcwnipg9mgcd8wgnicpd7txa"     crossorigin="anonymous"></script> <style> body {     padding-top: 70px;     /* required padding .navbar-fixed-top. remove if using .navbar-static-top. change if height of navigation changes. */ }  strong {     cursor: pointer; } </style> </head>  <body>      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">         <div class="container">             <!-- brand , toggle grouped better mobile display -->             <div class="navbar-header">                 <button type="button" class="navbar-toggle" data-toggle="collapse"                     data-target="#bs-example-navbar-collapse-1">                     <span class="sr-only">toggle navigation</span> <span                         class="icon-bar"></span> <span class="icon-bar"></span> <span                         class="icon-bar"></span>                 </button>                 <a class="navbar-brand" href="#">start bootstrap</a>             </div>             <!-- collect nav links, forms, , other content toggling -->             <div class="collapse navbar-collapse"                 id="bs-example-navbar-collapse-1">                 <ul class="nav navbar-nav">                     <li><a href="#">about</a></li>                     <li><a href="#">services</a></li>                     <li><a href="#">contact</a></li>                 </ul>             </div>             <!-- /.navbar-collapse -->         </div>         <!-- /.container -->     </nav>     <div class="container">          <div class="row">             <div class="col-lg-12 text-center">                 <h1>rsc acquirer agent messages</h1>              </div>         </div>         <!-- /.row -->      </div>      <div ng-controller="examplecontroller">         <ul class="list-unstyled" class="list-group">             <li ng-repeat="t in data.transactions">                 <ul class="list-unstyled" style="border: none">                     <li ng-repeat="(key, value) in t" ng-if="key!='__opened'"                         class="list-group" style="border: none"><span                         class="glyphicon glyphicon-plus-sign"></span> <strong                         ng-click="t.__opened=!t.__opened">{{key}} </strong>                         <ul ng-if="t.__opened" class="list-unstyled">                             <li><strong                                 ng-click="value.request.__opened=!value.request.__opened"                                 class="list-group-item list-group-item-info"                                 style="border: none"> <span                                     class="glyphicon glyphicon-plus-sign"></span>request                             </strong>                                 <ul ng-if="value.request.__opened" class="list-unstyled">                                     **<li ng-repeat="re in value.request""list-group-item">                                          {{re.field}} {{re.length}} {{re.value}}</li>**                                 </ul></li>                             <li><strong                                 ng-click="value.response.__opened=!value.response.__opened"                                 class="list-group-item list-group-item-info"                                 style="border: none"><span                                     class="glyphicon glyphicon-plus-sign"></span>response</strong>                                 <ul ng-if="value.response.__opened" class="list-unstyled"                                     class="list-group-item">                                     <li ng-repeat="re in value.response""list-group-item" >                                         {{re.field}} {{re.length}} {{re.value}}</li>                                 </ul></li>                         </ul></li>                 </ul>             </li>         </ul>     </div>      <script src="https://code.jquery.com/jquery-3.2.1.js"         integrity="sha256-dzankj/6xz9si04hgrsxu/8s717jcizly3oi35eouye="         crossorigin="anonymous"></script>      <!-- bootstrap core javascript -->     <script src="bootstrap/js/bootstrap.min.js"></script>  </body> </html> 

the li , result below

  **<li ng-repeat="re in value.request""list-group-item">                                          {{re.field}} {{re.length}} {{re.value}}</li>**                                 </ul></li>  de-000 004 0110 de-001 008 00110010 00111010 00000000 00000000 00001110 11000001 10000000 00000010  de-003 006 003000 de-004 012 000000004100 de-007 010 0807063032 de-011 006 010424 de-012 006 163032 de-013 004 0807 de-015 004 0719 de-037 012 321916010424 

i want format display aligned below each field can separated , nicely display.

de-000      004        0110 de-001      008        00110010 00111010 00000000 00000000 00001110 11000001                                                  10000000 00000010  de-003      006        003000 

how can achieve tried use table format each loop columns not aligned properly. instead of displaying in table prefer without table.

you can this:

.list-unstyled{    list-style: none;  }  .list-unstyled li span{    display: inline-block;    margin-right: 40px;  }  .list-unstyled li span:last-child{    margin-right: 0;  }
<ul class="list-unstyled">      <li>      <span>de-000</span>      <span>004</span>      <span>0110</span>    </li>        <li>      <span>de-000</span>      <span>004</span>      <span>0110</span>    </li>        <li>      <span>de-000</span>      <span>004</span>      <span>0110</span>    </li>        <li>      <span>de-000</span>      <span>004</span>      <span>0110</span>    </li>    </ul>


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -