I cant display horizontally of my footer-signature class, i already made the css for it, but somehow it display vertically please help
/* note this code is views for pdf export */
<!DOCTYPE html>
<html>
<head>
<title>Detail Transaksi</title>
<style>
body {
font-family: Arial, sans-serif;
}
h3 {
text-align: center;
}
table {
border-collapse: collapse;
width: 100%;
margin-bottom: 2em;
}
table th, table td {
border: 1px solid #000000;
padding: 8px;
text-align: center;
}
.footer-signature {
display: flex;
justify-content: space-between;
text-align: center;
margin-top: 2em;
}
.signature-block {
display: flex;
flex-direction: row;
align-items: center;
}
.signature-space {
margin-top: 4em;
}
</style>
</head>
<body>
<h3>PERMOHONAN KEBUTUHAN ALAT TULIS KANTOR (ATK)</h3>
<h5>Unit: {{ $unit }}</h5>
<h5>Tanggal: {{ $tanggal }}</h5>
<table>
<thead>
<tr>
<th rowspan="2">No</th>
<th colspan="3">Kebutuhan</th>
<th rowspan="2">Keterangan</th>
</tr>
<tr>
<th>Nama Barang</th>
<th>Jumlah</th>
<th>Satuan</th>
</tr>
</thead>
<tbody>
@foreach ($items as $index => $item)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $item['nama_barang'] }}</td>
<td>{{ $item['jumlah'] }}</td>
<td>{{ $item['satuan'] }}</td>
<td>{{ $item['keterangan'] }}</td>
</tr>
@endforeach
</tbody>
</table>
<!-- Footer Section -->
<div class="footer-signature">
<div class="signature-block">
<div>Pemohon</div>
<div class="signature-space">(..........................................)</div>
</div>
<div class="signature-block">
<div>Petugas Gudang</div>
<div class="signature-space">(person name)</div>
</div>
<div class="signature-block">
<div>Operator Persediaan</div>
<div class="signature-space">(person name)</div>
</div>
</div>
</body>
</html>
i already try everything, even ask for chatGPT, and others AI but still wont work, it’s still display vertically not horizontally.
2
Answers
Firstly, you have to add a
flex-direction:row
in thefooter-signature
class. Secondly, adjust somediv
in the footer to get the output as given image.I adjusted a similar answer
css:
html:
I changed the flex direction to row and grouped text in divs, thus giving you this look:
space-between sets the three elements far apart, you may change this by different justify-content values, ‘center’ with proper margin / spacing looks the most similar to what you want.