1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

put image in table box

Discussion in 'HTML & Website Design' started by rezafh, Jan 28, 2020.

  1. #1
    i want put image like this picture in box. right before text. but icant

    this is my code i used but image goes up or down !
    <table>  <thead>    <tr>      <th width="121">Download link</th>      </tr>  </thead>  <tbody>    <tr>      <td><img src="https://upload7.ir/up/icon-article-navy.png" alt="" width="20" height="20" class="dlboxicon"/>[xfgiven_download]<a href="[xfvalue_download]"> [xfgiven_name] [xfvalue_name] [/xfgiven_name]</td>[/xfgiven_download] <a/>         </tr>  </tbody></table>
    Code (markup):
    rezafh, Jan 28, 2020 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Likes Received:
    Best Answers:
    Trophy Points:
    What praytell makes this tabular data? This is NOT a candidate to be styled with a TABLE... at all. ESPECIALLY with only one cell per TR. Remember, this is 2020 not 1997, tables for layout is BAD.

    Likewise that image is presentation, not content, so it has ZERO business in an IMG tag, apply it from your CSS.

    I'd make the entire upper area an anchor, set it to inline-block, pad the right side, and put the image as background-image middle-right. If the outer DIV (not a table) is set to text-align:center, the anchor will center.

    NOT a job for the markup you are using whatsoever. Have you learned about semantic markup (aka using HTML properly) or separation of presentation from content? I'm guessing not.
    deathshadow, Jan 28, 2020 IP