![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello all - I'm working on a site that has a survey page for users. I'm fairly new to css, but I want to use it for layout. In the page, the user has a a set of radio buttons, five of them, to pick from. What I want is a center-aligned table layout, with the top row being the titles of each radio button, and the bottom row being the radio buttons. Each cell would be the same width. If I were formatting this using html, I would simply use the table tags. But, I'm trying to do this using pure css. |
#3
| |||
| |||
|
|
I have a css layout that properly center-align and evenly space my radio buttons and their titles in IE 6, but in firefox, they are left-aligned. |
#4
| |||
| |||
|
|
Post a URL so we can see what you have done. Do not post code. |
#5
| |||
| |||
|
|
On Mar 11, 6:58 pm, Bergamot <berga... (AT) visi (DOT) com> wrote: Post a URL so we can see what you have done. Do not post code. http://nerdcraft.net/survey.html I have the grid of 1-5 questions and radio button answers layed out in a table. I couldn't find a tutorial for a css grid, so I hacked it for now. Ideally, I would like to have the question layout in css. |
|
In firefox, the progress area is properly left-aligned, but the whole bar is left-aligned. I want it to be in the center. |
#6
| |||
| |||
|
|
Why? the radio buttons look like tabular data to me. Use a table, except don't use icky presentational HTML attributes, like align=center. Mixing HTML and CSS styles will only make a mess, and a real PITA to maintain. BTW, putting the radio buttons in a table doesn't mean the whole page needs to be in a table. |
|
And use a better doctype. The one in that test page triggers quirks mode, which will not give consistent results across browsers as you've already discovered. Use HTML 4.01 strict if you want the best compatibility. In firefox, the progress area is properly left-aligned, but the whole bar is left-aligned. I want it to be in the center. Drop the align=center on that cell - that is for aligning text within the block, not for aligning blocks themselves. Look up margin:auto |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Or, let me ask a more general question: Is an html table an appropriate way to align any set of elements of an HTML page that are to be in a grid layout? |
|
Or is there a pure css way to do a grid-style layout? Something where you wanted, say, two rows and four columns of some elements, that all have the same width and spacing distribution? |
#9
| |||
| |||
|
|
Or, let me ask a more general question: Is an html table an appropriate way to align any set of elements of an HTML page that are to be in a grid layout? |
|
Or is there a pure css way to do a grid-style layout? Something where you wanted, say, two rows and four columns of some elements, that all have the same width and spacing distribution? |
#10
| |||
| |||
|
|
On 2008-04-13, lawpoop (AT) gmail (DOT) com <lawpoop (AT) gmail (DOT) com> wrote: Or, let me ask a more general question: Is an html table an appropriate way to align any set of elements of an HTML page that are to be in a grid layout? Supposedly not. You're only meant to use an HTML table if there's something abstractly tabular about the data independently of how it might be displayed. "Abstractly tabular" is a contrived idea since really a table is a kind of presentation. Perhaps a better criterion is whether the table layout is part of the meaning of the data. |
![]() |
| Thread Tools | |
| Display Modes | |
| |