fivem scripting I'm working on table NUI HTML <!DOCTYPE html> <html lang="en"> <head>…
- 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
- 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:
- Change the scale transform in your CSS from
#myTableto a new class, for example.table-container:
.table-container { transform: scale(0.5); transform-origin: 0 0; }- Wrap your table element with a new div that has the
table-containerclass 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.
- Change the scale transform in your CSS from
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.