简体   繁体   中英

How to make a table with Iframe responsive

i have been reading some of the post releted Resposive Website on StackExchange. Also tried some codes on my localhost but non of them worked out for me.

Project :- i have made an Hotel Booking Engine with object oriented programming in php i have made a form useing table structure where user can select the check in check out dates and other details.

Problem - i try to make the form resposive but nothing is working for me

Objective :- To make form responsive where people can select the Check in Check Out Dates

PHP Code

$output .='<table cellspacing="2" border="0" style="width: 100%; border-collapse: collapse;">';
            if(!empty($output_hotels)){
                $output .= '<tr><td><label>'._SELECT_HOTEL.':</label></td></tr>
                        <tr><td nowrap="nowrap">'.$output_hotels.'</td></tr>';                  
                $output .= '<tr><td><label>'._SELECT_LOCATION.':</label></td></tr>
                        <tr><td nowrap="nowrap">'.$output_locations.'</td></tr>';
            }           
            $output .= '<tr><td>'._CHECK_IN.': '.$output1.'</td>&nbsp;<tb>'._CHECK_OUT.':'.$output2.'</td>&nbsp;<td>'.$output3.'</td>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
            if(!empty($output_hotels)){
                $output .= '<tr><td style="height:5px"></td></tr>
                        <tr><td nowrap="nowrap">'.$output_sort_by.'</td></tr>';
            }
            $output .= '<input class="button" type="button" onclick="document.getElementById(\'reservation-form\').submit()" value="'._CHECK_AVAILABILITY.'" /></table>';

IFRAME Codes

if(hsJsHost != ''){

    var hsJsKey = (typeof hsJsKey === 'undefined') ? '' : hsJsKey;
    var hsJsHost = (typeof hsJsHost === 'undefined') ? '' : hsJsHost;

    if(hsJsKey != '' && hsJsHost != ''){

        var encoded_host = encode64(hsJsHost);
        var encoded_key = encode64(hsJsKey);        

        var filePath = 'widgets/ipanel-left/index.php?host='+encoded_host+'&key='+encoded_key;

        // setup the iframe target
        var iframe='<iframe id="frame" name="widget" src="#" width="15px" height="200px" marginheight="0" marginwidth="0" frameborder="no" scrolling="no"></iframe>';
        // write the iframe to the page
        document.write(iframe);

        var myIframe = parent.document.getElementById("frame");
        // setup the width and height
        myIframe.height = 100;
        myIframe.width = 815;

        myIframe.src = hsJsHost+filePath;
        // set the style of the iframe
        myIframe.style.border = "1px solid #aaa";
        myIframe.style.padding = "8px";
        myIframe.style.margin-right = "10px";
    }

}

Please help

you need to learn the basics of responsive CSS. That means media queries, % and em/rem values etc. here are some basic resources

Mozilla media query page

css units

You can't build much without this basic foundation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM