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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Nested table alignment

    How can I keep the rows aligned in the following nested table?

    Code:
    <!DOCTYPE html>
    <html>
    <body>
      <table>
        <tr>
          <th>Column A</th>
          <th>Column B</th>
          <th>Column C</th>
        </tr>
        <tr>
          <td>
    	<input />
    	<div><a href="#">Delete</a></div>
          </td>
          <td><input /></td>
          <td>
    	<table>
    	  <tr>
    	    <td><input  /></td>
    	    <td><input  /></td>
    	    <td><a href="#">Delete</a></td>
    	  </tr>
    	</table>
    	<a href="#" >Add</a>
          </td>
        </tr>
      </table>
    </body>
    </html>

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,478
    Thanks
    6
    Thanked 981 Times in 954 Posts
    Is there a specific reason why you are using a nested table at all? Unless you are writing HTML e-mails you should never use a table for layout anyway, and even more nested tables. Give us an idea what you are trying to achieve then we can help you find a more semantic solution.

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    Is there a specific reason why you are using a nested table at all? Unless you are writing HTML e-mails you should never use a table for layout anyway, and even more nested tables. Give us an idea what you are trying to achieve then we can help you find a more semantic solution.
    Actually this is a simplification of what I am trying to do. I am using KnockoutJS and templates (jquery tmpl) to generate the table. I am trying to do something like this http://knockoutjs.com/examples/contactsEditor.html
    The Phone numbers part is a nested table like in the example I posted. However it seems that the browser renders the rows misaligned and I don't understand why.


  •  

    Posting Permissions

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