html - <td> center body of text but text left align -


i know missing simple line fix.

i have tried <td align ="center"> while <p style="text-align:left;"> , vise versa. have played simple align="left" <p> well.

how make text centered in <td> links left aligned in center?

enter image description here

so far text left align isn't centered inside <td>

i tried adding centered div see in code. didn't work

        <td align="center" width="50%" style = "margin-left:50%">         <p align="center"><font size="5"><b>classified ads</b></font></p>         <br />          <div align="center">          <strong><!--edited 6/10/2015-->                               <p style="text-align:left;">                               <a href=".aspx">search classified ads</a></p>                                                                 <p style="text-align:left;">                                  <a href=".aspx">add or delete classified ad</a></p>                               <p style="text-align:left;">                                  <a href=".aspx">update existing classified ad</a></p>                               <p style="text-align:left;">                                  <a href=".aspx">all classified ads</a></p>                                <p style="text-align:left;">                                  <a href=".aspx">about application</a></p>          </strong>          </div>                               <p>                                 &nbsp;                               </p>                               <p>                                </p>                               <p align="center">                               <strong>                                      <font size="+1">note: classified ads expire after 30 days.</font>                                     <br />                                     today&#39;s date is&nbsp;                                   <asp:label id="datelabel" runat="server"></asp:label>                               </strong>                                </p>      </td> 

update:

i seem explaining want wrong. want this

enter image description here

<div>         <p style="text-align:center"><font size="5"><b>classified ads</b></font></p>         <br />          <div style="width:300px; margin: 0 auto;">              <strong><!--edited 6/10/2015-->                 <p>                     <a href=".aspx">search classified ads</a></p>                                                   <p>                     <a href=".aspx">add or delete classified ad</a></p>                 <p>                     <a href=".aspx">update existing classified ad</a></p>                 <p>                     <a href=".aspx">all classified ads</a></p>                  <p>                    <a href=".aspx">about application</a></p>             </strong>          </div>         <p>         &nbsp;         </p>             <p style="text-align:center">                   <strong>                      <font size="+1">note: classified ads expire after 30 days.</font>                     <br />                     today&#39;s date is&nbsp;                 </strong>              </p>           </div> 

i think need. first of all, when use align or text-align automatically used on child elements. if want align elements align those, needs it. second thing centering. can center block using margin: 0 auto (also need define width otherwise not work).

p.s: recommend not use td outside of table , not use align attribute. read write cleaner html: http://learn.shayhowe.com/html-css/


Comments