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. CSS Help Needed - Clickable Table Cell

CSS Help Needed - Clickable Table Cell

Scheduled Pinned Locked Moved Web Development
helpcssdatabasebeta-testingarchitecture
4 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.
  • B Offline
    B Offline
    BrianReeve
    wrote on last edited by
    #1

    I am developing a web application that will be viewed with Microsoft Internet Explorer 6 on a machine with touch screen. The touch screen is the only input/output device. There is no mouse or keyboard available for the end user. (Imagine an electronic information kiosk.) Here's my current problem: I am populating a table that contains square, "button-like" cells with information from a database. The buttons are styled using a CSS Style Sheet. I need the entire square cell to be hyperlink sensitive to accomodate for the inaccuracies of a touch screen. Centered vertically and horizontally in the button should be a link text. Currently, my solution allows for everything but centering the text vertically. I am using the following class to style a block hyperlink of size 75px by 75px: A.selectCategoryButton { display: block; width: 75px; height: 75px; vertical-align: middle; text-align: center; text-decoration: none; font-family: Verdana; font-size: 12px; color: white; border: 1px solid black; background-color: #0074E8; } An example of one cell in my table looks something like this:

    Link Text

    The result rendered in a browser is a 75px by 75px cell that is entirely "click-able" with all the properties defined in my class, BUT the text appears at the top of the button like this: ___________ | Link Text | | | | | | | |_________| I think this has to do with the fact that the CSS vertical-align property can only be used with in-line objects and not block objects. Any workarounds or other solutions? Feedback is greatly appreciated... This is a somewhat time sensitive project.

    I R R 3 Replies Last reply
    0
    • B BrianReeve

      I am developing a web application that will be viewed with Microsoft Internet Explorer 6 on a machine with touch screen. The touch screen is the only input/output device. There is no mouse or keyboard available for the end user. (Imagine an electronic information kiosk.) Here's my current problem: I am populating a table that contains square, "button-like" cells with information from a database. The buttons are styled using a CSS Style Sheet. I need the entire square cell to be hyperlink sensitive to accomodate for the inaccuracies of a touch screen. Centered vertically and horizontally in the button should be a link text. Currently, my solution allows for everything but centering the text vertically. I am using the following class to style a block hyperlink of size 75px by 75px: A.selectCategoryButton { display: block; width: 75px; height: 75px; vertical-align: middle; text-align: center; text-decoration: none; font-family: Verdana; font-size: 12px; color: white; border: 1px solid black; background-color: #0074E8; } An example of one cell in my table looks something like this:

      Link Text

      The result rendered in a browser is a 75px by 75px cell that is entirely "click-able" with all the properties defined in my class, BUT the text appears at the top of the button like this: ___________ | Link Text | | | | | | | |_________| I think this has to do with the fact that the CSS vertical-align property can only be used with in-line objects and not block objects. Any workarounds or other solutions? Feedback is greatly appreciated... This is a somewhat time sensitive project.

      I Offline
      I Offline
      Ian Darling
      wrote on last edited by
      #2

      Why not apply the v-align style to the TD element? -- Ian Darling "The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky

      1 Reply Last reply
      0
      • B BrianReeve

        I am developing a web application that will be viewed with Microsoft Internet Explorer 6 on a machine with touch screen. The touch screen is the only input/output device. There is no mouse or keyboard available for the end user. (Imagine an electronic information kiosk.) Here's my current problem: I am populating a table that contains square, "button-like" cells with information from a database. The buttons are styled using a CSS Style Sheet. I need the entire square cell to be hyperlink sensitive to accomodate for the inaccuracies of a touch screen. Centered vertically and horizontally in the button should be a link text. Currently, my solution allows for everything but centering the text vertically. I am using the following class to style a block hyperlink of size 75px by 75px: A.selectCategoryButton { display: block; width: 75px; height: 75px; vertical-align: middle; text-align: center; text-decoration: none; font-family: Verdana; font-size: 12px; color: white; border: 1px solid black; background-color: #0074E8; } An example of one cell in my table looks something like this:

        Link Text

        The result rendered in a browser is a 75px by 75px cell that is entirely "click-able" with all the properties defined in my class, BUT the text appears at the top of the button like this: ___________ | Link Text | | | | | | | |_________| I think this has to do with the fact that the CSS vertical-align property can only be used with in-line objects and not block objects. Any workarounds or other solutions? Feedback is greatly appreciated... This is a somewhat time sensitive project.

        R Offline
        R Offline
        Roger Wright
        wrote on last edited by
        #3

        I haven't tried it, so this is no more than a swag, but is it possible to place the text within

        tags and define the box characteristics (margins, padding, etc) for the P element to constrain the text to the center of the cell containing it? "Your village called -
        They're missing their idiot."

        1 Reply Last reply
        0
        • B BrianReeve

          I am developing a web application that will be viewed with Microsoft Internet Explorer 6 on a machine with touch screen. The touch screen is the only input/output device. There is no mouse or keyboard available for the end user. (Imagine an electronic information kiosk.) Here's my current problem: I am populating a table that contains square, "button-like" cells with information from a database. The buttons are styled using a CSS Style Sheet. I need the entire square cell to be hyperlink sensitive to accomodate for the inaccuracies of a touch screen. Centered vertically and horizontally in the button should be a link text. Currently, my solution allows for everything but centering the text vertically. I am using the following class to style a block hyperlink of size 75px by 75px: A.selectCategoryButton { display: block; width: 75px; height: 75px; vertical-align: middle; text-align: center; text-decoration: none; font-family: Verdana; font-size: 12px; color: white; border: 1px solid black; background-color: #0074E8; } An example of one cell in my table looks something like this:

          Link Text

          The result rendered in a browser is a 75px by 75px cell that is entirely "click-able" with all the properties defined in my class, BUT the text appears at the top of the button like this: ___________ | Link Text | | | | | | | |_________| I think this has to do with the fact that the CSS vertical-align property can only be used with in-line objects and not block objects. Any workarounds or other solutions? Feedback is greatly appreciated... This is a somewhat time sensitive project.

          R Offline
          R Offline
          Rohit Sinha
          wrote on last edited by
          #4

          Use padding to achieve what you want. Regards, Rohit Sinha Browsy

          Do not wait for leaders; do it alone, person to person. - Mother Teresa

          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