<table border="1" width="600" align="center">
       <tr>
         <td colspan="2" align="right">date</td>
       </tr>

         <tr>
            <td width="10%">avatar</td> //cant balance those two proportionally 10 to 90
            <td  width="90%">message</td>
         </tr>

        <tr>
            <td colspan="2" align="right">
                  <table border="1" width="600">
                    <tr>
                          <td width="48%"></td>
                            <td width="10%" align="center"><input type="button" value="Edit" style="width:50px"/> </td>
                            <td width="12%" align="center"><input type="button" value="Remove" style="width:60px"/> </td>
                            <td width="10%" align="center"><input type="button" value="Quote" style="width:50px"/> </td>
                            <td width="10%" align="center"><input type="button" value="Reply" style="width:50px"/> </td>
                            <td width="10%" align="center"><input type="button" value="Rep" style="width:50px"/> </td>
                    </tr>
                  </table>

            </td>


        </tr>
    </table>

如果从上面看,这些单元格的比例将不起作用。我希望一个单元格为10%,其他单元格为90%

最佳答案

<table border="1" width="600" align="center">
   <tr>
     <td colspan="2" align="right">date</td>
   </tr>

     <tr>
        <td style="width:60px">avatar</td>
        <td style="width:540px">message</td>
     <tr>

    <tr>
        <td colspan="2" align="right">
              <table border="1" width="600">
                <tr>
                      <td width="48%"></td>
                        <td width="10%" align="center"><input type="button" value="Edit" style="width:50px"/> </td>
                        <td width="12%" align="center"><input type="button" value="Remove" style="width:60px"/> </td>
                        <td width="10%" align="center"><input type="button" value="Quote" style="width:50px"/> </td>
                        <td width="10%" align="center"><input type="button" value="Reply" style="width:50px"/> </td>
                        <td width="10%" align="center"><input type="button" value="Rep" style="width:50px"/> </td>
                </tr>
              </table>

        </td>


    <tr>
</table>

关于html - 样式化HTML表格,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8018595/

10-09 16:07