20.9.2011 3:08, Angela French wrote:
If I only have one row, do I need to use the display:table-row
> as a parent container, or can I just use the table-cells?
Someone can surely come up with a theoretical answer, but I would simply
wrap any cell inside a row and any row inside a table, e.g.
<!doctype html>
<title>cells</title>
<style>
.table { display: table; width: 100%; }
.row { display: table-row; }
.cell { display: table-cell; border: solid; width: 50%; }
</style>
<div class=table>
<div class=row>
<span class=cell>foo</span>
<span class=cell>bar</span>
</div>
</div>
Also, I have two cells and wand each a width of 50%, but the browser
> is not rendering it as directed.
Firefox 6 and IE 9 show the above with such widths. IE 7 and earlier
don't support display: table-cell and relatives, so tabular formatting
in CSS isn't practical on web pages yet, in most cases.
I suppose you didn't set a width on an enclosing element. Without such a
setting, width: 50% raises the question "50% of _what_?"
--
Yucca, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/