I'm trying to work out whether CSS grid is capable of behaving like a table.
So if I have a long piece of "cell data" (col 2) and there's space available elsewhere in the table, I don't want it to wrap as it does in the image below:
What I want to achieve is something like this. Where the column with the longer piece of content grows and the other columns shrink based on the content in that column.
I've uploaded an example here on CodePen: https://codepen.io/anon/pen/WdNJdY
.wrapper {
display: grid;
grid-template-columns: 33.33% 33.33% 33.33%;
background-color: #fff;
color: #444;
max-width: 800px;
}
.box {
background-color: #444;
color: #fff;
border-radius: 5px;
padding: 20px;
font-size: 150%;
}
<div class="wrapper">
<div class="box a">col 1</div>
<div class="box b">col 2</div>
<div class="box c">col 3</div>
<div class="box d">short data</div>
<div class="box e">a really long piece of data</div>
<div class="box f">short data</div>
</div>
I'm very new to CSS grid so I'm curious if this is possible.
Any help is appreciated. Thanks in advance!