Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2006
    Posts
    225
    Thanks
    6
    Thanked 3 Times in 3 Posts

    Bordering blocks of <td>

    Is there a way to put a border around blocks of <td>'s, that spread across multiple rows, short of having a new table for each block?

    If you don't understand what I mean, I took the liberty of drawing a simple picture, where the entire image is the table:



    I'm not sure how this could be achieved without simply making a big table, with each block of <td>'s as a smaller table, which I want to avoid if possible.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title></title>
    <style type="text/css">
    html, body {
    margin:0;
    padding:0;
    }
    #container {
    width:636px; /* total width of .boxhold table * # of boxes */
    margin:auto;
    }
    .boxhold {
    float:left;
    }
    .boxhold table { /* total width = width + (margin * 2) + 2 */
    border:1px solid #000;
    width:200px;
    margin:5px;
    }
    .boxhold table td {
    border:1px solid #000;
    margin:5px;
    }
    .clear {
    clear:both;
    line-height:0px;
    font-size:0;
    }
    </style>
    </head>
    <body>
    <div id="container">
    	<div class="boxhold">
    		<table border="0" cellpadding="0" cellspacing="5">
    			<tr>
    				<td colspan="2">&nbsp;</td>
    			</tr>
    			<tr>
    				<td>&nbsp;</td>
    				<td>&nbsp;</td>
    			</tr>
    			<tr>
    				<td>&nbsp;</td>
    				<td>&nbsp;</td>
    			</tr>
    		</table>
    	</div>
    	<div class="boxhold">
    		<table border="0" cellpadding="0" cellspacing="5">
    			<tr>
    				<td colspan="2">&nbsp;</td>
    			</tr>
    			<tr>
    				<td>&nbsp;</td>
    				<td>&nbsp;</td>
    			</tr>
    			<tr>
    				<td>&nbsp;</td>
    				<td>&nbsp;</td>
    			</tr>
    		</table>
    	</div>
    	<div class="boxhold">
    		<table border="0" cellpadding="0" cellspacing="5">
    			<tr>
    				<td colspan="2">&nbsp;</td>
    			</tr>
    			<tr>
    				<td>&nbsp;</td>
    				<td>&nbsp;</td>
    			</tr>
    			<tr>
    				<td>&nbsp;</td>
    				<td>&nbsp;</td>
    			</tr>
    		</table>
    	</div>
    	<div class="clear">&nbsp;</div>
    </div>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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