Results 1 to 2 of 2

Thread: Fieldset and table row alignments

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Fieldset and table row alignments

    With the following...
    Code:
    <style>
    	fieldset {
    		display : inline;
    	}
    </style>
    
    	<body>
    	
    		<table>
    			<tr>
    				<td rowspan="5">
    					<fieldset>
    						<legend>Test title</legend>
    						<table>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    						</table>
    					</fieldset>
    				</td>
    			</tr>
    			<tr>
    				<td>Testing: <input type="text" /></td>
    			</tr>
    			<tr>
    				<td>Testing: <input type="text" /></td>
    			</tr>
    			<tr>
    				<td>Testing: <input type="text" /></td>
    			</tr>
    			<tr>
    				<td>Testing: <input type="text" /></td>
    			</tr>
    		</table>
    I get this...


    But what I really need is this...


    Is there a way to preserve the same row alignments outside the fieldset as within?

    Attached Images Attached Images   
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Fieldset and table row alignments

    What you really have is two tables. One beside the other - I suppose you could fiddle around with the margins and paddings of the TD elements using CSS, but, the best option will be to create another table. You canuse the tabindex attribute if you want to traverse them in a more logical order.
    Code:
    <html>
    	<head>
    <style>
    	fieldset {
    		display : inline;
    	}
    
    	fieldset legend {
    		height: 15px;
    	}
    
    	.fake_fieldset {
    		margin-top: 15px;
    	}
    </style>
    
    	<body>
    	
    		<table>
    			<tr>
    				<td rowspan="5">
    					<fieldset>
    						<legend>Test title</legend>
    						<table>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    						</table>
    					</fieldset>
    				</td>
    				<td>
    					<div class="fake_fieldset">
    						<table>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    							<tr>
    								<td>Testing: <input type="text" /></td>
    							</tr>
    						</table>
    					</div>
    				</td>
    			</tr>	
    		</table>
    	</body>
    </html>
    Don't forget to fix the height of the legend to ensure the fields align.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width