asmith Posted January 7, 2008 Share Posted January 7, 2008 hey guys i have a table in a fieldset, i want to put it in middle of the fieldset , but i can't figure how . i tried : ( i mean verticaly middle ) <filedset> <table valign="middle"> .. but it won't work . i tried similar thing with CSS vertical align, that won't work too .i put table in div , and set things for div , but that doesn't work too . any idea ? Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 7, 2008 Share Posted January 7, 2008 create a nested table; that should do the trick - something like this: <fieldset> <table height=100% width=100% cellpadding=0 cellspacing=0 align=center valign=center> <td height=100% width=100% align=center valign=center> <table align=center width=500 height=350 border=1> <td align=center valign=middle width=500 height=350> I'm In The Middle of It All! </td> </table> </td> </table> </fieldset> Quote Link to comment Share on other sites More sharing options...
AndyB Posted January 8, 2008 Share Posted January 8, 2008 Two observations: #1 <fieldset><table ....> </table></fieldset> will always put your table vertically in the middle of the fieldset provided you set margins and padding appropriately. #2 fieldset in not meant to be something to wrap around things other than logically grouped form inputs and controls. I can't tell which is causing your problem, given that you fail to provide either code or a live example which illustrates what you see as a problem. Quote Link to comment Share on other sites More sharing options...
dbrimlow Posted January 11, 2008 Share Posted January 11, 2008 So I assume you are designating a fieldset for a form element and the form elements are within a table? If you designate widths for the fieldset and table in css, you could specify margin:0 auto for the table: Either in the head <style> tag, external css: fieldset {width:100%} table {width:80%;margin:0 auto} or markup inline: <fieldset style="width:100%"> <table style="width:80%; margin:0 auto"> Don't forget the legend tag after fieldset and the "label for=" tags in the table cells. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.