代码之家  ›  专栏  ›  技术社区  ›  suresh

增加HTML中td单元格的宽度和高度

  •  1
  • suresh  · 技术社区  · 6 年前

    我正在尝试根据我的要求增加td单元的宽度和高度。

    这是我的代码:

    <div class=“margin-top-10”>
    表;
    TSBOR>
    T>
    <td style=“Vertical Align:top;”><?php echo$this->remarksform->remarktype;?</TD & GT;
    T>&?php echo$this->remarksform->remark;?</TD & GT;
    TD & GT;
    &?php echo$this->remarksform->id;
    echo$this->remarksform->保存;?gt;
    &T/GT;
    & LT/TR & GT;
    &T/BOT>
    &表;
    &L/DIV & GT;
    < /代码> 
    
    

    以下是我现在所拥有的结果:

    以下是我想要的结果图像:

    我怎样才能做到这一点?

    事先谢谢。

    以下是我现在所拥有的结果: enter image description here

    以下是我想要得到的结果图像:

    enter image description here

    我怎样才能做到这一点?

    事先谢谢。

    3 回复  |  直到 6 年前
        1
  •  1
  •   vssadineni    6 年前

    下面是一个例子:

    <div class=“margin-top-10”>
    表;
    TSBOR>
    T>
    <td style=“Vertical Align:top;”><选择><选项>一个</选项><选项>两个</选项></选择></td>
    <td style=“Vertical Align:top;”><textArea></textArea></td>
    <td style=“垂直对齐:top;”>
    <button>谢谢您</button>
    &T/GT;
    & LT/TR & GT;
    &T/BOT>
    &表;
    &L/DIV & GT;
    < /代码> 
    
    

    reference image for the posters desired alignment for the above html.

        2
  •  0
  •   Sam Walpole    6 年前

    您可以添加此样式:

    height: 50px;
    
        3
  •  0
  •   Tushar Kumawat    6 年前
     Please add width:
        <div class="margin-top-10">
        <table cellspacing='0' cellpadding='0'>
            <tbody>
                <tr>
                    <td width="20%" style="vertical-align:top;">test</td>
                    <td width="70%">test</td>
                    <td width="10%">test</td>
                </tr>
            </tbody>
        </table>
    </div>