Вложенный стол, увеличивающий ширину внешнего стола - PullRequest
2 голосов
/ 19 мая 2011

У меня есть вложенная таблица:

<table border="0" width="750" cellspacing="0" cellpadding="0">
  <tr align="center">
     <td width="530">
         <table border="0" cellspacing="0" cellpadding="0" width="530">
             <tr>
                 <td>
                   <tr>
                            <td width="14"></td>
                            <td width="177">
                                <p style="color:#333333; line-height: 20px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight:bold; text-align: left; margin-left: 0px; padding-top: 0px;">Expand Your Reach</p>
                                <ul style="color:#767676; line-height: 20px; font-size: 12px; font-family: Helvetica, Arial, sans-serif; list-style-image:url(http://demo.frostmiller.com/sss104/images/bullet.jpg);text-align:left; margin-left: 25px; padding:0; list-style-position:outside;">
                                    <li>Contrary to popular belief, Lorem Ipsum is not simply random text. </li>
                                    <li>Contrary to popular belief, Lorem Ipsum is not simply random text. </li>
                                    <li>Contrary to popular belief, Lorem Ipsum is not simply random text. </li>
                                </ul>
                                <br />
                            </td>
                            <td width="29"></td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <hr width="220" />
                            </td>
                        </tr>
                        <tr>
                            <td width="14"></td>
                            <td width="177" align="left">
                                <p style="color:#333333; line-height: 20px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight:bold; text-align: left;">Contact Info</p>
                                <p style="color:#767676; line-height: 20px; font-size: 12px; font-family: Helvetica, Arial, sans-serif; text-align: left; margin-bottom: 2cm;">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer  .</p>
                            </td>
                            <td width="29"></td>
                        </tr>
                </td>
             </tr>
         </table>
     </td>
     <td width="220">
     </td>
  </tr>
</table>

Я создаю html-сообщение, поэтому нет другого выбора, кроме как вкладывать таблицы.

Здесь, как только я включу внутреннюю таблицушириной 530 внутри ячейки шириной 530 граница внешнего стола смещается и расширяется.Как я могу это остановить?

Ответы [ 2 ]

3 голосов
/ 19 мая 2011
  1. Ваш HTML-код недействителен, таблицы неправильно вложены (там есть дополнительные элементы tr и td)

  2. Математика не складывается, поэтому трудно понять, что вы делаете, вложенная таблица - 14+177+29 = 220, но она есть внутри ячейки 530

  3. Если вы исправите вложение и измените

    <td width="530">
       <table border="0" cellspacing="0" cellpadding="0" width="530">
    

    до:

    <td width="530">
       <table border="0" cellspacing="0" cellpadding="0" width="100%">
    

    это должно исправить все проблемы с выравниванием, которые еще остались

0 голосов
/ 09 февраля 2017

Добавьте colspan="4" к внешнему <td>, в котором находится вложенное <table>.

...