Jump to content

Forms And Tabled Css


beakofthoth

Recommended Posts

I am trying to have form elements display as table elements, so that semantics is not violated by the use of tables. I have a generic login form that looks like this:<form><div><label for="uname">User Name</legend><input id="uname" type="text"></div><div><label for="pass">Password</label><input id="pass" type="password"></div></form>My CSS looks like this:form {display: table;}form div {display: table-row;}legend {display: table-cell;}input {display: table-cell;}What am I doing wrong?

Link to comment
Share on other sites

IE throws a fit when you try to use display modes of any table variety. If it's neatness you're after, use float, width, margins, and padding on your divs. Especially float and width. That's how you'll get them to line up like cells. Use clear when you want to start a new "row."

Link to comment
Share on other sites

IE throws a fit when you try to use display modes of any table variety. If it's neatness you're after, use float, width, margins, and padding on your divs. Especially float and width. That's how you'll get them to line up like cells. Use clear when you want to start a new "row."
I'm using Firefox as my main test browser, and it doesn't work there either. I *expect* new techniques not to work in IE :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...