Sorry about the title, I couldn't really think of a way to explain this in a single line.
I am attempting to lay out a "table" with three "cells" in a "column" (quotes are because I want to use CSS to lay this out, not a table). The center cell contains an image, which I want to be centered on, and I want the "cells" on either side of the image to be equal in width.
I am using this as my CSS:
.psuedo-table {
display: table;
width: 100%;
table-layout: fixed;
border: 0;
margin-left: auto;
margin-right: auto;
}
.psuedo-table-row {
display: table-row;
}
.psuedo-table-column {
display: table-cell;
padding: 0 0 0 0;
margin: 0 0 0 0;
}
In my HTML, I have the following:
<div class="psuedo-table">
<div class="psuedo-table-row">
<div class="psuedo-table-column" style="background-color: #446078;"> </div>
<div class="psuedo-table-column" style="max-width: 100%; white-space: nowrap;">
<img src="/assets/images/appheader.png" />
</div>
<div class="psuedo-table-column" style="background-color: #162a52;"> </div>
</div>
</div>
Unfortunately, this doesn't work, as the three "cells" are the same width, and I need the middle "cell" to expand to the width of the <img> and the cells on the left and right to be equal width.
This is probably simple, but if anyone can help I would appreciate it.
. However, I will need to set a background color on the "empty" columns, so I do need them.