skip to Main Content

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.

this is the result i want

2

Answers


  1. Firstly, you have to add a flex-direction:row in the footer-signature class. Secondly, adjust some div in the footer to get the output as given image.

    .footer-signature {
        display: flex;
        justify-content: space-between;
        flex-direction: column;
        text-align: center;
        margin-top: 2em;
    }
    
    .signature-space {
        margin-top: 4em;
    }
    <div class="footer-signature">
        <div>Pemohon</div>
        <div class="signature-space">
            (..........................................)
            <div>Petugas Gudang</div>
        </div>
        <div class="signature-space">
            (person name)
            <div>Operator Persediaan</div>
        </div>
        <div class="signature-space">
            (person name)
        </div>
    </div>
    Login or Signup to reply.
  2. I adjusted a similar answer

    css:

    .footer-signature {
        display: flex;
        justify-content: space-between;
        flex-direction: row;
        text-align: center;
        margin-top: 2em;
    }
    
    .signature-space {
        margin-top: 4em;
    }
    

    html:

     <div class="footer-signature">
        <div>
            <div>Pemohon</div>
            <div class="signature-space">
                (..........................................)
            </div>
        </div>
    
        <div>
            <div>Petugas</div>
            <div class="signature-space">
                (person name)
            </div>
        </div>
    
        <div>
            <div>Operator</div>
            <div class="signature-space">
                (person name)
            </div>
        </div>
    </div>
    

    I changed the flex direction to row and grouped text in divs, thus giving you this look:

    Output image

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search