nachumk Posted October 27, 2009 Share Posted October 27, 2009 I am playing with CSS and I am having trouble with display:table-row... here's my code: (I'm expecting the elements to be displayed veritcally)<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><head><style type="text/css">.menu2 { display:table-row; }</style></head><body><input type = "button" class="menu2" value = "1"></input><input type = "button" class="menu2" value = "2"></input><input type = "button" class="menu2" value = "3"></input><input type = "button" class="menu2" value = "4"></input><em class="menu2">a</em><em class="menu2">b</em><em class="menu2">c</em><em class="menu2">d</em></body></html>What I see is like this:Chrome 3.0.195.27, Firefox 3.5.3:button1 button2 button3 button4abcdIE 8abcdNone of them align them as rows, and IE8 drops the buttons. I have tried wrapping elements in div and setting it to display:table. Doesn't help.I know I can use display:block, but I'm trying to understand this behavior.Thanks Link to comment Share on other sites More sharing options...
Ingolme Posted October 27, 2009 Share Posted October 27, 2009 Elements with display: tabe-row are expected to have other elements with a table-cell display inside them. I don't recommend their use, because more likely than not, if you completely need data to be displayed as a table you actually need a table.Browser support for table, table-row and table-cell is kind of poor. Link to comment Share on other sites More sharing options...
thescientist Posted October 27, 2009 Share Posted October 27, 2009 you could use float: left, or use lists with float:left. Link to comment Share on other sites More sharing options...
nachumk Posted October 28, 2009 Author Share Posted October 28, 2009 you could use float: left, or use lists with float:left.Another option is display:block. I was trying to understand why the table options don't work. Ingolme answered that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.