开发者

css Table-layout

开发者 https://www.devze.com 2023-02-05 01:04 出处:网络
Why is content in the table appears to start from the center.How to make it to start from where the row starts

Why is content in the table appears to start from the center.How to make it to start from where the row starts

 <table style="table-layout:fixed;width:100%;" border="1"  cellpadding="0" cellspacing="0" class="main_table" id="main_table">

   <tr>
                    <td width="20%" height="70px" align="center" id="plugins" class="step step1 clickable" step="1" onclick="javascript:getresource('1','0');">
                       <font color="blue">Plugins</font>
                    </td>
                       <td rowspan="5" width="80%" height="100%" align="center" ><br>
                          <div id="status" class="msg" style="display:none"><br></div>
                          <div id="header_msg" height="100%" align="center"></div>
                          <div id="contents" height="100%"></div>
                          </td>
                  </tr&g开发者_如何学Ct;

 </table>


Remove 'align="center"' from both td's and the 2nd div, and if you want the data to start at the top of the cell, add 'valign="top"' to the tr ie:

    <table style="table-layout:fixed;width:100%;" border="1"  cellpadding="0" cellspacing="0" class="main_table" id="main_table">

   <tr valign="top">
                    <td width="20%" height="70px" id="plugins" class="step step1 clickable" step="1" onclick="javascript:getresource('1','0');">
                       <font color="blue">Plugins</font>
                    </td>
                       <td rowspan="5" width="80%" height="100%"><br>
                          <div id="status" class="msg" style="display:none"><br></div>
                          <div id="header_msg" height="100%"></div>
                          <div id="contents" height="100%"></div>
                          </td>
                  </tr>

 </table>


Apart from the bloated use of inline CSS, HTML tables for layouts and the not-so-popular -tag, I'd guess it's the..

align="center"

..that centers your content. Try replacing it with "left" instead. Do consider doing it the CSS way though:

text-align: left;


Use vertical-align:top

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号