S
S
Sergey2018-03-04 19:28:34
css
Sergey, 2018-03-04 19:28:34

What is the best way to implement such a structure?

5a9c1f94693c4397950591.jpeg
How to implement such a structure? IE 8+ support

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2018-03-04
@abfrontend

<div class="form">
    
    <div class="form-col">
      <span class="label">Email</span>
      <span class="field">john</span>
    </div>
    ...
    
    <div class="form-col">
      
      <div class="form-col-2">
        <span class="label">Postcode</span>
        <span class="field">2009</span>
      </div>
      
      <div class="form-col-2">
        <span class="label">Country</span>
        <span class="field">Australia</span>
      </div>
    
    </div>
  
  </div>

<style>
    .form{
      max-width: 400px;
      width: 100%;
    }
    .form-col .label{
      float: left;
      width: 80px;
    }
    .form-col .field{
      display: block;
      margin: 0 0 0 100px;
    }
    .form-col{
      border-bottom: 1px solid #ccc;
      overflow: hidden;
    }
    .form-col-2{
      float: left;
      width: 50%;
    }
</style>

H
HamSter, 2018-03-04
@HamSter007

Tables should be typeset tables:

<div class="table-wrap">
  <table>
  <tbody>
    <tr>
      <td><span>Email</span></td> <td colspan="3">[email protected]</td>
    </tr>
    <tr>
      <td><span>Phone</span></td> <td colspan="3">02 9282 2888</td>
    </tr>
    <tr>
      <td><span>Adress</span></td><td colspan="3">1 Darling <br> Lorem</td>
    </tr>
    
    <tr>
      <td>
        <span>Postcode</span>
      </td>
      <td>
        2009
      </td>
      
      <td>
        <span>Country</span>
      </td>
      <td>Australia</td>
    </tr>
  </tbody>
</table>
</div>

Example on codepen

I
ink, 2018-03-05
@AskMy

it's almost without css : https://codepen.io/topicstarter/pen/XZwpro

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question