1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linking Directly To A Pic In A Table

Discussion in 'Web Design' started by redrubies, Jan 21, 2013.

  1. redrubies

    redrubies Supreme Member

    Joined:
    Jan 17, 2011
    Messages:
    1,424
    Likes Received:
    2,560
    Location:
    USA
    I think I screwed something up. If you have a table with rows of thumbnails, how do you link to one product in the table? Say you want to put a link on twitter of a pic in the second row of the table, third box. What is the code for the link to go directly to that pic? Thank you!
     
  2. gabfire

    gabfire Newbie

    Joined:
    Aug 10, 2012
    Messages:
    26
    Likes Received:
    9
    You can link directly to it, but it won't be very specific if there are 3 items in the row, it'll just put that row at the top of the page on load. The way you do it is as follows:

    In your row where the pic is (in your example 2nd row, 3rd column) you'll have to anchor the image. So use this HTML:

    Code:
    <a name="pic2ndrow3rdcolumn"><img src="blah/blah/blah.jpg" alt="blah"></a>
    
    You could wrap just the header of the field or whatever, but that is the anchor the browser will jump to. Now in your link on Twitter, you'll do this:

    Code:
    Hey guys, check out url/pagewithtable.html#pic2ndrow3rdcolumn
    
    That will cause the browser to load the HTML and then jump to that anchor tag.
     
    • Thanks Thanks x 1
  3. srb888

    srb888 Elite Member

    Joined:
    Jul 30, 2008
    Messages:
    3,260
    Likes Received:
    5,067
    Gender:
    Male
    Occupation:
    WebzSurfer
    Location:
    Sun, Mon, Tue, WTF, Sat!!! :)
    Code:
    [URL]http://www.w3schools.com/tags/tag_img.asp[/URL]
    Is this what you are looking for?
     
    • Thanks Thanks x 1
  4. redrubies

    redrubies Supreme Member

    Joined:
    Jan 17, 2011
    Messages:
    1,424
    Likes Received:
    2,560
    Location:
    USA
    Oh! I got it now. Thank you!
     
  5. gabfire

    gabfire Newbie

    Joined:
    Aug 10, 2012
    Messages:
    26
    Likes Received:
    9
    No, that's not at all what they're asking. Also - w3schools is a horrible HTML reference;) They've gotten better over the past few years, but there are still tons of things that are outright wrong on there:)
     
  6. srb888

    srb888 Elite Member

    Joined:
    Jul 30, 2008
    Messages:
    3,260
    Likes Received:
    5,067
    Gender:
    Male
    Occupation:
    WebzSurfer
    Location:
    Sun, Mon, Tue, WTF, Sat!!! :)
    I gave the same reference as you gave. The link has the same reference, <img src="asdfg" alt="asdfg">, and that's the start point from where you build the code (as you mentioned in your post). The site also has a easy "try the code yourself" on it which helps to build upon the basics, and so regardless of what you think of the site, it's still a good starting point for a beginner.

    If you know any related site that's better for learners and has a facility to test code like the above site, then please give a reference to that on the forum, so that members like OP and even I can benefit from it.