Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· openaiHugging Face Suzhen/CodeChat

fivem scripting I'm working on table NUI HTML <!DOCTYPE html> <html lang="en"> <head>…

  1. User

    fivem scripting I'm working on table NUI

    HTML

    table, th, td { border: 1px solid black; border-collapse: collapse; text-align: center; font-size: 14px; padding: 10px; }

    th { background-color: #eee; }

    #container { background-color: #3a3f52; padding: 30px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; }

    #tableWrapper { width: 50%; overflow: auto; }

    #myTable { width: 100%; transform: scale(0.5); transform-origin: 0 0; }

    https://cdn.discordapp.com/attachments/1052780891300184096/1103601899774693417/image.png For some reason the table scaled like it should've but the search, show entries , page select etc did not scale and has now vertically aligned itself

  2. Assistant

    It looks like you're trying to scale the table, but the DataTables pagination/search bar elements are not scaling with it. Here's a fix for this issue:

    1. Change the scale transform in your CSS from #myTable to a new class, for example .table-container:
    .table-container {
        transform: scale(0.5);
        transform-origin: 0 0;
    }
    
    1. Wrap your table element with a new div that has the table-container class in your HTML:
    <div id="tableWrapper">
        <div class="table-container">
            <table id="myTable" class="display">
                <thead>
                    <tr>
                        <th>Date</th>
                        <th>Agent</th>
                        <th>Buyer</th>
                        <th>Price</th>
                        <th>Address</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
    

    Now, the table and any pagination or search elements will be scaled consistently. This is because we're scaling the entire container div instead of just the table element.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.