gpt4 book ai didi

html - 两张并排的 table - 将一张 table 向右对齐

转载 作者:行者123 更新时间:2023-11-28 12:48:04 32 4
gpt4 key购买 nike

我试图在我的网站上并排显示 2 个表格(它实际上是一个包含两个子表格的表格)。我使用以下模板来完成它:(在 http://www.bignosebird.com/docs/h50.shtml 中找到)

<TABLE BORDER="1" WIDTH="500">
<TR>
<TD WIDTH=250>
<TABLE BORDER="1" WIDTH="250">
<TR>
<TD>
This is in our first table!
</TD>
</TR>
</TABLE>
</TD>
<TD WIDTH="250">
<TABLE BORDER="1">
<TR>
<TD WIDTH="250">
And this is in the second table!
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

问题是,我想将第二个表格对齐到屏幕的右侧。我试过:

<table border="1" align="right">

但它不起作用。有任何想法吗?谢谢!

最佳答案

你不应该使用表格来对齐东西。

你可以去掉父表,这样写:

<TABLE BORDER="1" WIDTH="250" style="float:left;">
<TR>
<TD>
This is in our first table!
</TD>
</TR>
</TABLE>

<TABLE BORDER="1" style="float:right;">
<TR>
<TD WIDTH="250">
And this is in the second table!
</TD>
</TR>
</TABLE>

或者:这个应该更好。使用 div 这是我们的第一张 table !

<div style="float:right;">
And this is in the second table!
</div>

关于html - 两张并排的 table - 将一张 table 向右对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17237418/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com