1

我喜欢下面的代码来创建一个表;但是,我希望在小数方程的右侧有“x =”部分。目前,“x =”位于分数方程的左侧。

如何更改代码,使“x =”在右侧?

<style>
td.upper_line { border-top:solid 1px black; }
table.fraction { text-align: center; vertical-align: middle;
margin-top:0.5em; margin-bottom:0.5em; line-height: 2em; } 
</style>

<table class="fraction" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td rowspan="2" nowrap="nowrap"> <i>x</i> = </td>
        <td nowrap="nowrap"> <i>x</i> <sup>2</sup> + <i>x</i> + 1</td>
    </tr>
    <tr>
        <td class="upper_line">2 cos(<i>x</i>)</td>
    </tr>
</table>
4

3 回答 3

1

这就是你所追求的吗?我已将 x= 更改为 =x,以便等式看起来正确。

<table class="fraction" align="center" cellpadding="0" cellspacing="0">
<tr>
    <td nowrap="nowrap">
        <i>x</i><sup>2</sup> + <i>x</i> + 1
    </td>
    <td rowspan="2" nowrap="nowrap">
      =  <i>x</i>  
    </td>
</tr><tr>
    <td class="upper_line">
        2 cos(<i>x</i>)
    </td>
</tr> </table>
于 2012-12-07T12:26:56.960 回答
0
<html>
<head>
<style>
td.upper_line { border-top:solid 1px black; }
table.fraction { text-align: center; vertical-align: middle;
margin-top:0.5em; margin-bottom:0.5em; line-height: 2em; } 
</style>
</head>
<body>


<table class="fraction" align="center" cellpadding="0" cellspacing="0">
    <tr>

        <td nowrap="nowrap"> <i>x</i> <sup>2</sup> + <i>x</i> + 1</td>
                       <td  rowspan="2" nowrap="nowrap"> = <i>x</i>  </td>
    </tr>
    <tr>

        <td class="upper_line">2 cos(<i>x</i>)</td>
    </tr>


</table>
</body>
</html>
于 2012-12-07T12:27:50.953 回答
0

你的意思是:

<td rowspan="2" nowrap="nowrap"> <i>x</i> = </td>
<td nowrap="nowrap"> <i>x</i> <sup>2</sup> + <i>x</i> + 1</td>

<td nowrap="nowrap"> <i>x</i> <sup>2</sup> + <i>x</i> + 1</td>
<td rowspan="2" nowrap="nowrap"> <i>x</i> = </td>
于 2012-12-07T12:28:01.873 回答