开发者

Setting width for different cells in a column

I'm making a simple website, but is there a way to keep the width of different columns separate? What would I need to switch around or change?

<table>
<tr><td width="50%">Site logo</td>
<td width="50%">Navigation</td></tr>
<tr><td width="100%">Art Examples</td></tr>
<tr><td width="60%">News</td>
<td width="40%">About Me</td></tr>
<tr><td width="100%">Other websites</td></tr>
<tr><td width="100%">Copyright</td></tr>
</table>

I'm such a newbie to HTML and 开发者_如何学Cdespite having a book right in front of me, I'm still confused about this part.


You need a colspan="2" on the <td> tags where you only want one <td> per row.

Like this:

<table>
<tr><td width="50%">Site logo</td>
<td width="50%">Navigation</td></tr>
<tr><td colspan="2">Art Examples</td></tr>
<tr><td width="60%">News</td>
<td width="40%">About Me</td></tr>
<tr><td colspan="2">Other websites</td></tr>
<tr><td colspan="2">Copyright</td></tr>
</table>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜