2016-09-04 5 views
0

ので、私はこの巨大なデータテーブルを持っていると私はlegalサイズの用紙でそれを印刷するときにそれらすべてに適合します。今、私が持っているすべては、用紙の大きさはあるが、私のCSSコードされているコンテンツは、ここで印刷時にCSSの表やコンテンツを調整する方法は?

に適合しない:

<div class="table-responsive"> 
<table border="1" style="table-layout: fixed;" align="center"> 
    <caption class="center">PERSONAL</caption> 
    <tr> 
    <th align="left">NAME: </th> 
    <td colspan="3"><input type="text" name="full_name" size="37" value="<?php echo $full_name; ?>" disabled></td> 
    <th colspan="1" align="left">MOBILE: </th> 
    <td><input type="text" name="phone_number" size="11" value="<?php echo $phone_number; ?>" disabled></td> 
    <th align="left">RANK: </th> 
    <td><input type="text" name="crew_rank" size="10" value="<?php echo $crew_rank; ?>" disabled></td> 
    </tr> 
    <tr> 
    <th align="left">DATE OF BIRTH: </th> 
    <td><input type="text" name="date_of_birth" size="17" value="<?php echo $date_of_birth; ?>" disabled></td> 
    <th align="left">AGE: </th> 
    <td><input type="text" name="age" size="5" value="<?php echo $age; ?>" disabled></td> 
    <th align="left">TELEPHONE NUMBER: </th> 
    <td><input type="text" name="telephone_number" size="11" value="<?php echo $telephone_number; ?>" disabled></td> 
    <th align="left">VESSEL: </th> 
    <td><input type="text" name="vessel" size="10" value="<?php echo $vessel; ?>" disabled></td> 
    </tr> 
    <tr> 
    <th align="left">PLACE OF BIRTH: </th> 
    <td colspan="3"><input type="text" name="place_of_birth" size="37" value="<?php echo $place_of_birth; ?>" disabled></td> 
    <th colspan="1" align="left">RELIGION: </th> 
    <td><input type="text" name="religion" size="11" value="<?php echo $religion; ?>" disabled></td> 
    <th align="left">JOINING DATE: </th> 
    <td><input type="text" name="joining_date" size="10" value="<?php echo $joining_date; ?>" disabled></td> 
    </tr> 
    <tr> 
    <th align="left">CITIZENSHIP/CIVIL STATUS</th> 
    <td><input type="text" name="citizenship" size="17" value="<?php echo $citizenship; ?>" disabled></td> 
    <td colspan="2"><input type="text" name="civil_status" size="16" value="<?php echo $civil_status; ?>" disabled></td> 
    <th colspan="1" align="left">SSS No.</th> 
    <td colspan="1"><input type="text" name="sss_number" size="11" value="<?php echo $sss_number; ?>" disabled></td> 
    <th align="left">JOINING PORT: </th> 
    <td colspan="2"><input type="text" name="joining_port" size="10" value="<?php echo $joining_port; ?>" disabled></td> 
    </tr> 
    <tr> 
    <th align="left">SHOES/BOILER SUIT SIZE</th> 
    <td><input type="text" name="shoe_size" size="17" value="<?php echo $shoe_size; ?>" disabled></td> 
    <td><input type="text" name="boiler_size" size="5" value="<?php echo $boiler_size; ?>" disabled></td> 
    <th align="left">HT/WT</th> 
    <td><input type="text" name="ht" size="19" value="<?php echo $ht; ?>" disabled></td> 
    <td><input type="text" name="wt" size="11" value="<?php echo $wt; ?>" disabled></td> 
    <th>LAST VESSEL: </th> 
    <td><input type="text" name="last_vessel" size="10" value="<?php echo $last_vessel; ?>" disabled></td> 
    </tr> 
    <tr> 
    <th align="left">ADDRESS: </th> 
    <td colspan="7" align="center"><input type="text" name="address" size="111" value="<?php echo $address; ?>" disabled></td> 
    </tr> 
</table> 

注:私のtableここ

@page { 
    size: legal; 
} 
@page :left { 
    margin: 0.5cm; 
} 

@page :right { 
    margin: 0.5cm; 
} 

とあります:私はあなたが印刷メディアクエリを使用することができ、単一のページに収めることができ、テーブルを想定しtable

+0

https://www.google.com/search?q=fit+table+to+paper+print+css – mplungjan

+0

よろしくお願いいたします。ありがとうございました –

答えて

0

内のすべてのデータが含まれていませんでした。

@print{ 
.table-responsive:{ 
height:95%; 
} 
} 
+0

ああ、それは働いた。ありがとう。もう1つの質問ですが、印刷するときにテーブルの列をどのように壊すことができますか? –

+0

私があなたに与えた検索の最初のリンクの1つ。いくつかを調査し、一度に一つの質問をしてください。http://stackoverflow.com/questions/26777317/printing-html-table-with-many-columns-rows-using-css-layout – mplungjan

関連する問題