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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Grid alignment within table

Grid alignment within table

Scheduled Pinned Locked Moved ASP.NET
csstutorialquestion
6 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.
  • J Offline
    J Offline
    JacquesDP
    wrote on last edited by
    #1

    Hi guys, I have a table set to 100% width of the window. And style="text-align:center" Inside the table I have a gridview. When I view the site in IE it displayes the grid in the center of the table, but in firefox it displays the grid in the left of the table. Does anyone know why this happens and how to get it fixed? Thanks in advance

    No matter how long he who laughs last laughs, he who laughs first has a head start!

    L G A 3 Replies Last reply
    0
    • J JacquesDP

      Hi guys, I have a table set to 100% width of the window. And style="text-align:center" Inside the table I have a gridview. When I view the site in IE it displayes the grid in the center of the table, but in firefox it displays the grid in the left of the table. Does anyone know why this happens and how to get it fixed? Thanks in advance

      No matter how long he who laughs last laughs, he who laughs first has a head start!

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      NeroToxic wrote:

      Does anyone know why this happens and how to get it fixed?

      Yes it is a well known issue that browsers are not equal. Well known since like the very first ones. Google: Browser Compatibility

      led mike

      1 Reply Last reply
      0
      • J JacquesDP

        Hi guys, I have a table set to 100% width of the window. And style="text-align:center" Inside the table I have a gridview. When I view the site in IE it displayes the grid in the center of the table, but in firefox it displays the grid in the left of the table. Does anyone know why this happens and how to get it fixed? Thanks in advance

        No matter how long he who laughs last laughs, he who laughs first has a head start!

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        This happens because there is a bug/feature in IE that makes it apply text alignment to block elements. Text alignment should only be applied to inline elements, that's why Firefox doesn't apply it to the grid. Use margin-left:auto;margin-right:auto; on the grid to center it.

        Despite everything, the person most likely to be fooling you next is yourself.

        J 1 Reply Last reply
        0
        • J JacquesDP

          Hi guys, I have a table set to 100% width of the window. And style="text-align:center" Inside the table I have a gridview. When I view the site in IE it displayes the grid in the center of the table, but in firefox it displays the grid in the left of the table. Does anyone know why this happens and how to get it fixed? Thanks in advance

          No matter how long he who laughs last laughs, he who laughs first has a head start!

          A Offline
          A Offline
          Ashish Sehajpal
          wrote on last edited by
          #4

          have u tried the align attribute for the TD yet? <td align=center> <asp:gridview ..... /> </td>

          Ashish Sehajpal

          J 1 Reply Last reply
          0
          • G Guffa

            This happens because there is a bug/feature in IE that makes it apply text alignment to block elements. Text alignment should only be applied to inline elements, that's why Firefox doesn't apply it to the grid. Use margin-left:auto;margin-right:auto; on the grid to center it.

            Despite everything, the person most likely to be fooling you next is yourself.

            J Offline
            J Offline
            JacquesDP
            wrote on last edited by
            #5

            The grid does not have the attribute margin nor style. Thanks for the help, I used center align on td and that worked like a dream.

            No matter how long he who laughs last laughs, he who laughs first has a head start!

            1 Reply Last reply
            0
            • A Ashish Sehajpal

              have u tried the align attribute for the TD yet? <td align=center> <asp:gridview ..... /> </td>

              Ashish Sehajpal

              J Offline
              J Offline
              JacquesDP
              wrote on last edited by
              #6

              honestly I have no idea why I didn't think of that. Thanks, works like a dream

              No matter how long he who laughs last laughs, he who laughs first has a head start!

              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