Q:

How to write summation expression in HTML? 

How to write equivalent HTML expression for following Latex:  
$$\sum_{k=1}^Nk(N-k+1)  

The image is: 
 
I did like this: 
∑ <sub>k=1</sub> <sup>N</sup>  

but output is like this   
∑ k=1 N 
I am not good at HTML and I searched on web but couldn't find answer.  
Please help on this..Thanks! 

A:

If you need it for a lot of stuff in your project you'll probably find MathJax useful.  Otherwise if you need just this one formula then try this - DEMO
<p>
    <span>&Sigma;</span>
    k ( N - k + 1 )
</p>​

CSS
p {
    height: 50px;
    line-height: 50px;
}

span {
    position: relative;
    font-size: 2.5em;
    display: inline-block;
    line-height: .7em;
    vertical-align: middle;
}

span:before {
    font-size: 12px;
    display: block;
    position absolute;
    left: 0;
    top: 0;
    content: "N";
    width: 22px;
    text-align: center;
}

span:after {
    font-size: 12px;
    display: block;
    position absolute;
    left: 0;
    bottom: 0;
    content: "k = 1";
    width: 27px;
    text-align: center;
}
​

