JSFiddle - React, Tailwind, and code Playground
Drag and Drop File Panes - Table Layout - No JS
by skibulk
HTML
<table>
<tr>
<td id="top_row" class="row dropzone">
<div id="top_controls" class="col controls">
<p>Drag and Drop Files<br><i>or</i></p>
<p><button>Browse</button></p>
<p><button>Clear</button></p>
</div>
<div class="col file">
<p>File 1</p>
</div>
<div class="col file">
<p>File 1</p>
</div>
</td>
</tr>
<tr>
<td id="bottom_row" class="row dropzone">
<div id="bottom_controls" class="col controls">
<p>Drag and Drop Files<br><i>or</i></p>
<p><button>Browse</button></p>
<p><button>Clear</button></p>
</div>
</td>
</tr>
</table>
CSS
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
}
html {
overflow-x: scroll; /* Add scrollbar ahead of time, otherwise it'll make the table row heights uneven */
}
table {
min-width: 100%;
height: 100%;
table-layout: fixed;
border-spacing: 10px;
}
table td {
white-space: nowrap;
}
.col {
display: inline-block;
width: 200px;
height: 100%;
white-space: normal;
overflow: hidden;
}
.col + .col {
margin-left: 10px;
}
.controls {
display: inline-block;
height: 100%;
padding: 10px;
border: 2px dashed #aaa;
border-radius: 15px;
cursor: pointer;
font: Arial, sans-serif;
color: #666;
text-align: center;
user-select: none;
}
.controls:hover {
border-color: darkblue;
background: lightblue;
}