Td tag content is not right justified

I have a one row table with two columns. I want to align the content of the second column to the right ... My content is not right aligned. Can you check what is wrong there ....

Here is my code ....

<html><head>                                                                                                                             
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="content-style-type" content="text/css">                                                                                                                <style>

 table td{
 border:1px solid green;
 }

 #Paginator ul{ margin:0px;padding:0px;}
 #Paginator ul li{ font-family::Arial,Tahoma,helvetica,sans-serif;font-size:9pt;list-style:none;float:left;margin:2px;padding:4px 8px 2px 8px;border:1px solid     black;cursor:pointer;}
 #Paginator ul li,#PrevPage{display:none;}
 </style>     

<body>

 <table style="border:1px solid red;width:100%"><tr>
  <td>
    <b style="float:left;">Number of Matching Addresses:&nbsp; 49 &nbspNumber of pages:  5</b>
 </td>

 <td align="right">

 <script>

 var ga_pageId = new Array();
 function pageNavigate(){if(document.getElementById("FromPage")){ var fromPage  = parseInt( document.getElementById("FromPage").value);} if(document.getElementById("ToPage")){var toPage =  parseInt( document.getElementById("ToPage").value);}if(fromPage == 1){document.getElementById("PrevPage").style.display="none";} else{ document.getElementById("PrevPage").style.display="inline"; }if(toPage == 5  || toPage<5){document.getElementById("NextPage").style.display="none";}else{ document.getElementById("NextPage").style.display="inline"; }for(var j=0;j<ga_pageId.length;j++){if(document.getElementById(ga_pageId[j])){document.getElementById(ga_pageId[j]).style.display="none"}}for(var i=fromPage;i<=toPage; i++){ var pageId = 'PAGE_'+i;if(document.getElementById(pageId))document.getElementById(pageId).style.display="inline"; }}

 function previousPage(){var fromPageEle = document.getElementById("FromPage");var toPageEle = document.getElementById("ToPage");if(fromPageEle && toPageEle){fromPageEle.value = parseInt(fromPageEle.value) - 1;toPageEle.value =  parseInt(toPageEle.value) - 1;pageNavigate();}}

 function nextPage(){var fromPageEle = document.getElementById("FromPage");var toPageEle = document.getElementById("ToPage");if(fromPageEle && toPageEle){fromPageEle.value = parseInt(fromPageEle.value) + 1;toPageEle.value =  parseInt(toPageEle.value)  + 1; pageNavigate();}}

 function pageOver(lv_this){if(lv_this.selected!='X')lv_this.style.backgroundColor = "#52CFCF";}
 function pageOut(lv_this){if(lv_this.selected!='X')lv_this.style.backgroundColor = "#E6EFFA";}

 </script>

   <div id="Paginator">
   <input type="hidden" id="FromPage" value="1"/>
   <input type="hidden" id="ToPage" value="5 "/>
    <ul > 

      <li onClick="previousPage()" id="PrevPage"><span>PREV</span></li>
      <script> ga_pageId.push('PAGE_1');</script>

      <li id="PAGE_1">1 </span></li>
      <script> ga_pageId.push('PAGE_2');</script>

      <li id="PAGE_2" >2 </span></li>
      <script> ga_pageId.push('PAGE_3');</script>

      <li id="PAGE_3" >3 </span></li><script> ga_pageId.push('PAGE_4');</script>

      <li id="PAGE_4">4 </span></li>
      <script> ga_pageId.push('PAGE_5');</script>

      <li id="PAGE_5">5 </span>
      </li>
      <li onClick="nextPage()" id="NextPage" style="display:none"><span>NEXT</span></li>
     </ul> </div>

 <script> pageNavigate()</script>

  </td>
  </tr>
</table>

</body></html>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

      

+3


source to share


3 answers


Add this css:



 #Paginator ul{ margin:0px;padding:0px; float:right;}

      

+3


source


You already have an answer in the previous tag <TD>

style="float:left;"

. Why don't you use it for the second one <TD>

?



 You can use the Following options
    1. <td style="float:right;">
    2. <div id="Paginator" style="float:right;" >
    3. #Paginator ul{ margin:0px;padding:0px; float:right;}

      

+1


source


Since your content is wrapped in div

. The div expands to size td

and its content is aligned to the left. Add text-align: right

ul li to the Paginator style.

-1


source







All Articles