Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai friends Table column contain fractional numbers like 34.6 , 1.34, 290.324

how to align this numbers by dot position.


___1.1
__11.3
1111.1


in this all dot placed in same position, how to align like this
Posted
Updated 11-Mar-15 0:23am
v3
Comments
deepankarbhatnagar 11-Mar-15 6:10am    
Do center align
smksamy 11-Mar-15 6:13am    
34.6
1.34
290.324

smksamy 11-Mar-15 6:14am    
_34.6
__1.34
290.324

leave the underscore , consider only numbers and dots, how to align data in this format
Mohibur Rashid 11-Mar-15 6:20am    
With css? May be with html. Try either with div or with table
smksamy 11-Mar-15 6:24am    
___1.1
__11.3
1111.1

like this

CSS alone can't do this...
Here a nice jQuery plugin that will help you...
https://github.com/ndp/align-column[^]
 
Share this answer
 
You can do it as following:


XML
<table>
    <tr>
        <td style="text-align:right;">1111.1
        </td>
    </tr>
    <tr>
        <td style="text-align:right;">1.1
        </td>
    </tr>
    <tr>
        <td style="text-align:right;">
            11.3
        </td>
    </tr>
</table>
 
Share this answer
 
Comments
Kornfeld Eliyahu Peter 11-Mar-15 15:47pm    
It is work only in case you have the exact same number of digits to the right of the decimal point - OP clearly gave a different sample...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900