html - Left align a group of tables so that they all appear on the same line -


here html:

<body>     <div class="horizontal-scroller">         <table class="float-left">             <tr>                 <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>             </tr>         </table>         <table class="float-left">             <tr>                 <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>             </tr>         </table>         <table class="float-left">             <tr>                 <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>             </tr>         </table>     </div> </body> 

and css:

.float-left {   float: left; }  .horizontal-scroller {     overflow-x: auto; } 

i trying achive effect 3 tables appear on same row no matter size of containing div. example works when page wide enough fit them. when shrink size of page tables start wrap. don't want happen. instead want horizontal scrollbar appear on div user can scroll see them. how can achieve this?

plunker example: https://plnkr.co/edit/ffsvoradervgdi1rff31?p=preview

display: flex on parent put in flex row

/* styles go here */    .horizontal-scroller {      overflow-x: auto;      display: flex;  }
<div class="horizontal-scroller">        <table>          <tr>            <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>          </tr>        </table>        <table>          <tr>            <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>          </tr>        </table>        <table>          <tr>            <td>lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>          </tr>        </table>  </div>


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -