I have a related / preliminary question here.
The following CSS and HTML, adapted from here is, I think, a good start, or at least intriguing:
CSS
.container {
display: table;
}
.row {
display: table-row;
}
.column {
display: table-cell;
}
HTML
Note: I've added the IDs
<div class="container">
<div class="row" id="row1">
<div class="column" id="row1Col1">Column 1</div>
<div class="column" id="row1Col2">Column 2</div>
<div class="column" id="row1Col3">Column 3</div>
</div>
<div class="row" id="row2">
<div class="column" id="row2Col1">Date goes here</div>
<div class="column" id="row2Col2">Shift1</div>
<div class="column" id="row2Col3">Blank to begin with</div>
</div>
</div>
But I need to dynamically add to this, so that each Column1 always stays as "tall" as the corresponding Column2 as rows are added to Column2 and that, as rows are added to Column3, the first row of Column2 (the Shift, such as "Shift 1") keeps vertical pace with it. So you would have something like this:
Column1 Column2 Column3
====== ====== ======
Mon Aug 24 Shift 1 Something about Shift1
More about Shift1
Yet more about Shift1
Shift 2 Something about Shift2
More about Shift2
Shift 3 Something about Shift3
Tues Aug 25 Shift1
To be as clear as possible, I will show what the appearace would be before any programmatic additions are made:
Column1 Column2 Column3
====== ====== ======
Mon Aug 24 Shift 1
...then after adding two more rows ("Shift1" and "Shift2") to Column2, and related verbiage in Column3:
Column1 Column2 Column3
====== ====== ======
Mon Aug 24 Shift 1 Something about Shift1
Shift 2 Something about Shift2
Shift 3 Something about Shift3
...then adding some more info about Shift1 in Column3:
Column1 Column2 Column3
====== ====== ======
Mon Aug 24 Shift 1 Something about Shift1
More about Shift1
Yet more about Shift1
Shift 2 Something about Shift2
Shift 3 Something about Shift3
...I think you get the picture (both Column1 and Column2 grow vertically to keep pace with the verbiage about Shift1 from Column2 in Column3). Then, the same would happen if verbiage was added in Column3 related to Shift2:
Column1 Column2 Column3
====== ====== ======
Mon Aug 24 Shift 1 Something about Shift1
More about Shift1
Yet more about Shift1
Shift 2 Something about Shift2
More about Shift2
Shift 3 Something about Shift3
So, I was thinking I could accomplish it this way: When programmatically adding a Row inside Column2 (such as "Shift2" or "Shift3" up to "ShiftN"), also add a row to Column1 (in my scenario, when adding a row (another Shift) to Column2, add a "blank" row to Column1 to keep them the same height).
But then it gets more complicated: When adding a row to Column3 about Shift1, also add rows to both Column1 and Column2 just prior to the "Shift2" row or append to the end if "Shift1" is the only one.
So my question is: How can I programmatically (in JavaScript) add "sub-divs" to divs (pseudo/CSS rows inside pseudo/CSS columns)?