www.webdeveloper.com
Results 1 to 7 of 7

Thread: hide a block of html

  1. #1
    Join Date
    Apr 2010
    Posts
    7

    hide a block of html

    I need to somehow hide this block of HTML code in my page. Now I have no control over the code as it comes from another site so there is no ID or anything. If the <a> or <td> tags had ID I could hide it with javascript. Any idea guys?

    Code:
    <tr>
    <td>
    <center style="color: rgb(82, 87, 87); font-size: 10px;">Some Text <a target="_blank" style="color: rgb(82, 87, 87); font-size: 10px;" href="http://google.com/">google is good</a>
    </center>
    </td>
    </tr>

  2. #2
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    What do you mean it comes from another site? Just the content in the table cell or everything?

    You can't hide something on someone else' site.

    Explain.

  3. #3
    Join Date
    Apr 2010
    Posts
    7
    Quote Originally Posted by yamaharuss View Post
    What do you mean it comes from another site? Just the content in the table cell or everything?

    You can't hide something on someone else' site.

    Explain.
    Sorry didn't explain it properly.

    In my website, I am embedding a third party widget and the code I pasted here is from the widget. The table (the code that I pasted here comes from another site) Is that clear?

    I am not trying to hide stuff in someone else site. I am trying to hide the content in my site. The above code is in my site.

  4. #4
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    I am assuming you want a function that hides/shows the content, otherwise why have it in the first place.

    Create a div block around your inserted content

    <div id="mycontent">
    --dynamic content here
    </div>

    Do you need to know how to show/hide the div?

  5. #5
    Join Date
    Apr 2010
    Posts
    7
    The problem here is I have an entire table and the below code is just one <TR>.

    So for example:

    <table>
    <tr><td>data1</td></tr>
    <tr><td>data2</td></tr>
    <tr><td>data3</td></tr>
    <tr><td>data4</td></tr>
    <tr><td>data5</td></tr>
    <table>

    Now how do I not show the last <tr>? Yes, I would ike the javascript code too.

    Code:
    <tr>
    <td>
    <center style="color: rgb(82, 87, 87); font-size: 10px;">Some Text <a target="_blank" style="color: rgb(82, 87, 87); font-size: 10px;" href="http://google.com/">google is good</a>
    </center>
    </td>
    </tr>

  6. #6
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    You should have been more specific to begin. I do not believe this is possible without some server-side parsing of the content before it is displayed.

  7. #7
    Join Date
    Aug 2004
    Location
    New York
    Posts
    339
    If that is the only center tag then you may just need to hide the center tag under the div wrapper with css. #mycontent center {display:none;}

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles