样式html表

时间:2011-11-05 06:33:16

标签: html css dreamweaver

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

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

你错过了第一行的tr。

<table border="1" width="600" align="center">
<tr>
         <td colspan="2" align="right">date</td>
</tr>
         <tr>
            <td width="10%" style="">avatar</td>
            <td  width="90%">message</td>
        <tr>
        <tr>
            <td colspan="2" align="right">
                  <table border="1" width="600">
                    <tr>
                          <td width="70%">&nbsp;</td>
                            <td width="10%" align="right"><input type="button" value="Quote" style="width:50px"/> </td>
                            <td width="10%" align="right"><input type="button" value="Reply" style="width:50px"/> </td>
                            <td width="10%" align="right"><input type="button" value="Rep" style="width:50px"/> </td>
                    </tr>
                  </table>

            </td>


        <tr>
    </table>