I'm trying to get basic CSS "table" styling to work, but I can't figure out how to get a table element to span multiple columns. My HTML looks like this:
<div class="dtable">
<div class="dspan-row">
<div class="dcell">This text wants to span all 3 columns</div>
</div>
<div class="drow">
<div class="dcell">First name:</div>
<div class="dcell">Bob</div>
<div class="dcell">Something else</div>
</div>
<div class="drow">
<div class="dcell">Last name:</div>
<div class="dcell">Smith</div>
<div class="dcell">Something else</div>
</div>
</div>
My CSS looks like this:
.dtable {display: table;}
.drow {display: table-row;}
.dcell {
display: table-cell;
padding: 10px;
}
.dcell > * {vertical-align: middle;}
.dspan-row {???}
How can I style a dspan-row class so that the text spans all of the table columns? And do I need to use a child element to supply the text for the row that spans all of the columns, or is there some magic I can use to eliminate that child element and just write
<div class="dspan-row">This text wants to span all 3 columns</div>