CSS表格布局
问题描述:
为什么在表中的内容似乎从center.How开始,使其从地方开始行开始CSS表格布局
<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>
</table>
答
删除“ALIGN =‘中心’”来自TD的和第二格,如果你想要的数据在顶部开始该单元格将“valign =”top“'添加到tr中即:
<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>
答
除了臃肿的使用内嵌的CSS,HTML表格的布局和不那么受欢迎的标签,我猜这是...
align="center"
..以集中您的内容。尝试用“左”代替它。不要认为,虽然这样做的CSS方式:
text-align: left;