...

View Full Version : Nested table alignment



dmz17
09-15-2011, 01:07 PM
How can I keep the rows aligned in the following nested table?


<!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>

VIPStephan
09-15-2011, 01:25 PM
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 (http://en.wikipedia.org/wiki/Semantic_HTML) solution.

dmz17
09-15-2011, 02:11 PM
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 (http://en.wikipedia.org/wiki/Semantic_HTML) 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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum