Jump to content

Forms And Tabled Css


beakofthoth
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...