Bagaimana cara mencetak tanggal ke samping??

kan ini tanggalnya kebawah

bagaimana cara membuat tanggalnya ke samping kaya gini, saya contohnya pake exel

Untuk Source codenya

 <style type="text/css">
  div{
  -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px;
  -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px;
  -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
  -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
  }
  body{
  font-family:Arial, Helvetica, sans-serif;
  font-size:11px;
  }
  .hari{
  float:left;
  padding:5px;
  width:40px;
  text-align:center;
  margin:2px;
  background:#0CF;
  background-image:-webkit-linear-gradient(top,#ffffff 0%,#3e9ad2 100%);
  background-image:-moz-linear-gradient(top,#ffffff 0%,#3e9ad2 100%);
  background-image:-o-linear-gradient(top,#ffffff 0%,#3e9ad2 100%);
  background-image:-ms-linear-gradient(top,#ffffff 0%,#3e9ad2 100%);
  background-image:linear-gradient(top,#ffffff 0%,#3e9ad2 100%);
}
  .tgl{
  float:left;
  padding:5px;
  width:40px;
  text-align:center;
  margin:2px;
  background:#CCC;
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
  background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
  background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
  background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
  background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
  background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
  }
  .tgl:hover{
  background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
  background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
  background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
  background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
  background-image: -o-linear-gradient(top, #049cdb, #0064cd);
  background-image: linear-gradient(top, #049cdb, #0064cd);
  color:#FFF;
  }
  .float_habis{
  padding:1px;
  text-align:center;
  }
  .tgl_blank{
  float:left;
  padding:5px;
  width:40px;
  text-align:center;
  margin:2px;
  background:#F8F8F8;
  color:#CCC;
  }

  .tgl_skrng{
  float:left;
  padding:5px;
  width:40px;
  text-align:center;
  margin:2px;
  background:#FC0;
  }

  .blokbaris{
  padding:5px;
  text-align:center;
  margin:2px;
  }
</style>
<?php
$now = getdate(time());
$time = mktime(0,0,0, $now['mon'], 1, $now['year']);
$date = getdate($time);
$dayTotal = cal_days_in_month(0, $date['mon'], $date['year']);
//Print the calendar header with the month name.
print '<strong>' . $date['month'] . '</strong>';
print '<div class=blokbaris>';
$hari=array('Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu');
for ($i = 0; $i < 7; $i++) {
print "<div class='hari'>$hari[$i]</div>";
}
print '<div class=float_habis> </div></div>';

for ($i = 0; $i < 6; $i++) {
print '<div class=blokbaris>';
for ($j = 1; $j <= 7; $j++) {
$dayNum = $j + $i*7 - $date['wday'];
//Print a cell with the day number in it.  If it is today, highlight it.
print '<div';
if ($dayNum > 0 && $dayNum <= $dayTotal) {
print ($dayNum == $now['mday']) ? ' class=tgl_skrng>' : ' class=tgl>';
print "$dayNum";
}
else {
//Print a blank cell if no date falls on that day, but the row is unfinished.
print ' class=tgl_blank> - ';
}
print '</div>';
}
print '<div class=float_habis> </div></div>';
if ($dayNum >= $dayTotal && $i != 6)
break;
}
?>

avatar samsularifin05
@samsularifin05

114 Kontribusi 13 Poin

Diperbarui 5 tahun yang lalu

3 Jawaban:

kedua image di atas sama vertikal, keduanya pasang tanggal ke bawah. Apakah yang di maksud agar tanggalnya horisontal? hari di kiri dan tanggal di kanan?

avatar VikSintus
@VikSintus

96 Kontribusi 36 Poin

Dipost 5 tahun yang lalu

maksd saya kaya gini gan

<img src=' http://www.diskusiweb.com/uploads/editor/49/dn0an255ob9v.jpg '> tanggalnya otomatis ke samping ngambil dari bulan sekrang, itu saya ngebuat manual

Source code fpdfnya nah si kotak kotak itu selanjutnya ngeget dari database <pre> &lt;?php // memanggil library FPDF require('fpdf.php'); // intance object dan memberikan pengaturan halaman PDF $pdf = new FPDF('l','mm','A4'); // membuat halaman baru $pdf-&gt;AddPage(); // setting jenis font yang akan digunakan $pdf-&gt;SetFont('Arial','B',9); // mencetak string $pdf-&gt;Cell(190,7,'LAPORAN SURAT PERINTAH PERJALANAN',0,1,'C'); $pdf-&gt;SetFont('Arial','B',12); //$pdf-&gt;Cell(190,7,'DAFTAR SISWA KELAS IX JURUSAN REKAYASA PERANGKAT LUNAK',0,1,'C');

// Memberikan space kebawah agar tidak terlalu rapat $pdf-&gt;Cell(10,7,'',0,1);

$pdf-&gt;SetFont('Arial','B',10);

$pdf-&gt;Cell(90,6 ,'NAMA MAHASISWA',1,0); $pdf-&gt;Cell(186,6,'TANGGAL',1,1);

$pdf-&gt;SetFont('Arial','',8); $pdf-&gt;Cell(90,6,'',1,0); $pdf-&gt;Cell(6,6 ,'1',1,0); $pdf-&gt;Cell(6,6 ,'2',1,0); $pdf-&gt;Cell(6,6 ,'3',1,0); $pdf-&gt;Cell(6,6 ,'4',1,0); $pdf-&gt;Cell(6,6 ,'6',1,0); $pdf-&gt;Cell(6,6 ,'6',1,0); $pdf-&gt;Cell(6,6 ,'7',1,0); $pdf-&gt;Cell(6,6 ,'8',1,0); $pdf-&gt;Cell(6,6 ,'9',1,0); $pdf-&gt;Cell(6,6 ,'10',1,0); $pdf-&gt;Cell(6,6 ,'11',1,0); $pdf-&gt;Cell(6,6 ,'12',1,0); $pdf-&gt;Cell(6,6 ,'13',1,0); $pdf-&gt;Cell(6,6 ,'14',1,0); $pdf-&gt;Cell(6,6 ,'16',1,0); $pdf-&gt;Cell(6,6 ,'16',1,0); $pdf-&gt;Cell(6,6 ,'17',1,0); $pdf-&gt;Cell(6,6 ,'18',1,0); $pdf-&gt;Cell(6,6 ,'19',1,0); $pdf-&gt;Cell(6,6 ,'20',1,0); $pdf-&gt;Cell(6,6 ,'21',1,0); $pdf-&gt;Cell(6,6 ,'22',1,0); $pdf-&gt;Cell(6,6 ,'23',1,0); $pdf-&gt;Cell(6,6 ,'24',1,0); $pdf-&gt;Cell(6,6 ,'26',1,0); $pdf-&gt;Cell(6,6 ,'26',1,0); $pdf-&gt;Cell(6,6 ,'27',1,0); $pdf-&gt;Cell(6,6 ,'28',1,0); $pdf-&gt;Cell(6,6 ,'29',1,0); $pdf-&gt;Cell(6,6,'30',1,0); $pdf-&gt;Cell(6,6,'31',1,1);

$pdf-&gt;SetFont('Arial','',10);

include 'koneksi.php'; $pegawai = mysqli_query($connect, "select * from pegawai"); while ($row = mysqli_fetch_array($pegawai)){ $pdf-&gt;Cell(90,6,$row['Nama'],1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,'',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,0); $pdf-&gt;Cell(6,6,' ',1,1);

}

$pdf-&gt;Output(); ?&gt; </pre>

avatar samsularifin05
@samsularifin05

114 Kontribusi 13 Poin

Dipost 5 tahun yang lalu

rombak dan edit beberapa div dan class sbb:

<pre> div{ float:left; }

.hari{ float:none; }

.tgl{ float:none; }

.tgl_blank{ float:none; } </pre>

avatar VikSintus
@VikSintus

96 Kontribusi 36 Poin

Dipost 5 tahun yang lalu

Login untuk ikut Jawaban