0

How to make column span with div?

I want to join divs using class .div-table-col.

This is my code:

.div-table {
  display: table;
  width: 100%;
  align: center; 
}
.div-table-row {
  display: table-row;
  width: auto;
  clear: both;
  width: 100%;
  margin:10px;
}
.div-table-col {
  float: left;
  display: table-column;
  width: 50%;
}
.div-table-col .title {
  text-align: right;
  margin: auto;
  margin-left: -10px;
}
.div-table-col .data {
  text-align: left;
  text-indent: 0.5em;
  margin:auto;
}
<div class="div-table-row">            
  <div class="div-table-col title"></div>
  <div class="div-table-col data"></div>        
</div>
yqlim
  • 6,898
  • 3
  • 19
  • 43
dMilan
  • 257
  • 3
  • 13

1 Answers1

1

I suggest to look at Flexbox. It's much easier to create columns.

 // CSS //
.flexcontainer {
   display: flex;
   flex-direction: row;
}

// HTML //
<body>
   <div class="flexcontainer">
      <div>column1</div>

      <div>column2</div>
   </div>
</body>
oputyk
  • 159
  • 1
  • 12