Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. center allign a text in a label

center allign a text in a label

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorial
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vipin Venugopal
    wrote on last edited by
    #1

    Hi Friends, Can anyone please tell me how to center allign a text in a label(server control). Vipin

    _ P A 3 Replies Last reply
    0
    • V Vipin Venugopal

      Hi Friends, Can anyone please tell me how to center allign a text in a label(server control). Vipin

      P Offline
      P Offline
      P S Pundeer
      wrote on last edited by
      #2

      Hi Vipin add this style attribute to your label control either in html mode or through code- label1.attributes.add("style","TEXT-ALIGN: center") or style="TEXT-ALIGN: center"> All the best puranonnet

      V 1 Reply Last reply
      0
      • V Vipin Venugopal

        Hi Friends, Can anyone please tell me how to center allign a text in a label(server control). Vipin

        _ Offline
        _ Offline
        _AK_
        wrote on last edited by
        #3

        put that label in a table column and make that table column as center align.

        Best Regards, Apurva Kaushal

        V 2 Replies Last reply
        0
        • V Vipin Venugopal

          Hi Friends, Can anyone please tell me how to center allign a text in a label(server control). Vipin

          A Offline
          A Offline
          amaneet
          wrote on last edited by
          #4

          You need to put the l;abel control into the td tag which has an align property and setit to center.Hope this may solve ur problem.

          V 1 Reply Last reply
          0
          • P P S Pundeer

            Hi Vipin add this style attribute to your label control either in html mode or through code- label1.attributes.add("style","TEXT-ALIGN: center") or style="TEXT-ALIGN: center"> All the best puranonnet

            V Offline
            V Offline
            Vipin Venugopal
            wrote on last edited by
            #5

            Thank u so much Pundeer. Ur answer worked. Once again Thank u. Vipin

            1 Reply Last reply
            0
            • _ _AK_

              put that label in a table column and make that table column as center align.

              Best Regards, Apurva Kaushal

              V Offline
              V Offline
              Vipin Venugopal
              wrote on last edited by
              #6

              Thank u so much 4 ur suggestion. I will try it Out.. Vipin

              1 Reply Last reply
              0
              • A amaneet

                You need to put the l;abel control into the td tag which has an align property and setit to center.Hope this may solve ur problem.

                V Offline
                V Offline
                Vipin Venugopal
                wrote on last edited by
                #7

                Yes It solved my problem. Thank u amaneet. Vipin

                1 Reply Last reply
                0
                • _ _AK_

                  put that label in a table column and make that table column as center align.

                  Best Regards, Apurva Kaushal

                  V Offline
                  V Offline
                  Vipin Venugopal
                  wrote on last edited by
                  #8

                  Thank u Apurva. It worked fine. Vipin

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups