MathCurvesSurfacesWallpaper GroupsGallerySoftwarePOV-Ray
ProgramingLinuxPerl PythonHTMLCSSJavaScriptPHPJavaLang DesignEmacsUnicode ♥

Pure CSS Table

, , …,

This page is a example of using CSS to format tabular data, without using the HTML <table> tag.

Here's a example of CSS table rendered in your browser:

one
two
three
four
five
six

Here's the HTML code:

<div class="a">
  <div class="b">
    <div class="c1">one</div>
    <div class="c2">two</div>
  </div>
  <div class="b">
    <div class="c1">three</div>
    <div class="c2">four</div>
  </div>
  <div class="b">
    <div class="c1">five</div>
    <div class="c2">six</div>
  </div>
</div>

Here's the CSS code:

.a, .b, .c1, .c2 {border:solid thin red}
.a {display:table}
.b {display:table-row}
.c1, .c2 {display:table-cell}

(For the complete raw HTML file, see: CSS Table Example.)

Here's a full list of values for the “display” attribute to emulate table tags.

blog comments powered by Disqus