html - Aligning a table to the second column of another table -
i want align second <table>
in <div>
. table should start second column of first table. right now, second table text “1111111111111” starts extreme left wish align textboxes start in first table.
here html:
<div style="float: left; height: 250px;overflow:auto; display:block;margin-left: 10px"> <table border="1"> <tr> <td style="padding-left: 10px; font-size: 24px;text-align: center" colspan="2">title</td> </tr> <tr> <td style="padding-top: 10px;"> <asp:label runat="server">first name</asp:label> </td> <td style="padding-top: 10px;padding-left: 10px"> <input type="text" /> </td> </tr> <tr> <td style="padding-top: 10px;"> <asp:label runat="server">email</asp:label> </td> <td style="padding-top: 10px;padding-left: 10px"> <input type="text" /> </td> </tr> <tr> <td style="padding-top: 45px;"></td> <td style="text-align: center"></td> </tr> </table> <table border="1"> <tr> <td style="padding-top: 20px; word-wrap: break-word;text-align: center">1111111111111</td> </tr> </table> </div>
set margin-left
value 33%
2nd table using :nth-child(2)
table:nth-child(2) { margin-left: 33%; }
<div style="float: left; height: 250px;overflow:auto; display:block;margin-left: 10px"> <table border="1"> <tr> <td style="padding-left: 10px; font-size: 24px;text-align: center" colspan="2">title</td> </tr> <tr> <td style="padding-top: 10px;"> <asp:label runat="server">first name</asp:label> </td> <td style="padding-top: 10px;padding-left: 10px"> <input type="text" /> </td> </tr> <tr> <td style="padding-top: 10px;"> <asp:label runat="server">email</asp:label> </td> <td style="padding-top: 10px;padding-left: 10px"> <input type="text" /> </td> </tr> <tr> <td style="padding-top: 45px;"></td> <td style="text-align: center"></td> </tr> </table> <table border="1"> <tr> <td style="padding-top: 20px; word-wrap: break-word;text-align: center">1111111111111</td> </tr> </table> </div>
Comments
Post a Comment