2012-12-07 40 views
1

我喜欢下面的代码来创建一个表;不过,我希望在分数方程的右边有“x =”部分。此刻,“x =”位于分数方程的左侧。如何将两行左侧的单元格更改为其右侧? (HTML/Tables ...)

我该如何更改代码,以便“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> 
+0

没有完全得到你的问题。但是我认为[MathML](http://en.wikipedia.org/wiki/MathML)是方程的一个很好的解决方案。 [演示](http://www.mathjax.org/demos/mathml-samples/)。 – xiaoyi

回答

1

这是你在追求什么?我已经将x =更改为an = 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> 
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> 
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> 
相关问题