www.webdeveloper.com
Results 1 to 8 of 8

Thread: Shrinkable cell

  1. #1
    Join Date
    May 2005
    Posts
    208

    Shrinkable cell

    How can I create a cell in a table which shrinks when browser window is (to smaller size)resized? For example, I have an image which width is 100px. When window is resized (to smaller size) only part of the image is visible not 100px in width but 50 px (for example). The image is not jammed but only part of it is visible. How can I achieve this?
    Thanks guys.

  2. #2
    Join Date
    Jul 2004
    Location
    Sendai, Japan
    Posts
    1,273
    Put it in the background.

    Even better, get rid of the table. It's difficult to give the best advice for your page as I haven't seen it, but you're obviously using tables for layout rather than for tabular data. Stop it.

  3. #3
    Join Date
    May 2005
    Posts
    208
    what is tabular data?

  4. #4
    Join Date
    Jul 2004
    Location
    Sendai, Japan
    Posts
    1,273
    Quote Originally Posted by thisObject
    what is tabular data?
    That's stuff like schedules, sports stats and share prices - usually things where you might visibly see a table that has headings for each column and the first item on each row is the subject of the row (I think you know what I mean).

  5. #5
    Join Date
    May 2005
    Posts
    208
    ######### **************************** #########
    ######### **************************** #########
    ######### **************************** #########
    ##TEXT### **IMG*********************** ##TEXT###
    ######### **************************** #########
    ######### **************************** #########
    ######### **************************** #########
    ######### **************************** #########

    Here is exactly what I have.
    When I resize the browser window the imgage stays the same but I can't see
    the text on the right side I need to have the following when the window is resized

    ######### ******* #########
    ######### ******* #########
    ######### ******* #########
    ##TEXT### **IMG** ##TEXT###
    ######### ******* #########
    ######### ******* #########
    ######### ******* #########
    ######### ******* #########

    So, some part of the image is not visible.

    How can I do that? Thank you.

  6. #6
    Join Date
    Jul 2004
    Location
    Sendai, Japan
    Posts
    1,273
    Put it in the background.

    Can you show me your page (a link)?

  7. #7

    Shrinking images

    Just did that this morning...

    This is the JAVASCRIPT part of the code... The PHP script (not shown) creates the required ID tags for this to work...

    <body class="s" onLoad="resize()">

    <script type="text/javascript">
    PHP Code:

              
    var IE4 = (document.all) ? 0;
              function 
    setObj_wh(obj_,w,h){
             
    with(document){
                 if(
    typeof obj_ == "string"){
                     if(
    0getElementById(obj_).style.width    w;
                     if(
    0getElementById(obj_).style.height    h;
                 }else{    
                     if(
    0obj_.style.width    w;
                     if(
    0obj_.style.height    h;
                 }    
             }
         }

         function 
    resize(){
           
    with(document){
             var 
    tNum '';
             var 
    mDate = new Date();
             var 
    mday mDate.getDate() ;
             var 
    cColumns 8.0;
             var 
    hMult =    (IE4) ? 0.11 0.095;
             var 
    wMult =    ((98.0 cColumns) / 100.0) ;
             var 
    w_ Math.round(body.clientWidth wMult);
             var 
    h_ Math.round(body.clientHeight hMult);
             for(var 
    i=1i<= 31i++){
               
    tNum '' parseInt(i);
               if(
    <= mday){
                 if(
    <= 9tNum '0' tNum;
                 
    tObj 'pic'+tNum
                 
    setObj_wh(tObjw_,0);
               }
             }
           }
         }
         
    window.onresize = function() { resize() }; 
    </script>
    Not perfect, but functional.

    an example ( a bit racey... so beware ) is the following link:
    http://jdgsoftco.no-ip.com/stare.php
    Last edited by griff777; 06-21-2005 at 06:13 PM.

  8. #8
    Join Date
    May 2005
    Posts
    208
    background thingy worked! Thanks a lot to all of you!!!

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