Keith Groben
Keith Groben

Reputation: 301

How do I get IE to display CSS DIV tables properly?

I get very favorable results in Firefox and Chrome, however, IE just doesn't display the DIV's as tables. Any help would be appreciated. Here is the markup I am using:

CSS

.table {
   display: inline-table;
   padding: 3px;
}
.row {
   display: table-row;
}
.cell {
   display: table-cell;
   width: 210px;
   height: 35px;
}

HTML

<div class="table">
   <div class="row">
      <div class="cell">Cell 1</div>
      <div class="cell">Cell 2</div>
      <div class="cell">Cell 3</div>
   </div>
</div>

Upvotes: 0

Views: 1076

Answers (2)

BoltClock
BoltClock

Reputation: 723729

I am using div's to display table data—

Hold it right there.

HTML has a whole category of markup devoted to tables that has been around since at least HTML 2.0, if not its inception. That's over half a decade before table display properties surfaced in CSS2.1, and just about the same time the first browser wars started.

If it's tabular data, use a table!

<table>
   <tr>
      <td>Cell 1</td>
      <td>Cell 2</td>
      <td>Cell 3</td>
   </tr>
</table>

Upvotes: 2

j08691
j08691

Reputation: 207901

Seems to work in IE8 once you fix the class names. http://jsfiddle.net/Ukg9r/1/

Upvotes: 0

Related Questions