dynamic width html table with css

I am trying to solve an issue with html tables. I have a table that will have 6 columns.
but they will be laid out in the page like this:

  1. the first column should have a minimum width so that it can hold upto 20 characters. If there are more than 20 characters, then it will have the text ellipses effect (three dots).
  2. the second and third column will have a fixed width.
  3. the fourth column will have 4 side by side divs inside it.each of this divs will hold some texts and the texts inside will have ellipses effect.
  4. The fifth column will also have a text ellipses effect.
  5. the sixth column is a fixed width column.

Here is what I tried:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Responsive Vue Table</title>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
    <style>
        .table-container {
            width: 100%;
            overflow-x: hidden;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
        }

        th,
        td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* First column with min-width for 20 characters */
        th:first-child,
        td:first-child {
            min-width: 160px;
            /* Approximately 20 characters */
            max-width: 200px;
            width: 15%;
        }

        /* Fixed width for second, third and sixth columns */
        th:nth-child(2),
        td:nth-child(2),
        th:nth-child(3),
        td:nth-child(3),
        th:nth-child(6),
        td:nth-child(6) {
            width: 100px;
        }

        /* Fourth column takes more space */
        th:nth-child(4),
        td:nth-child(4) {
            width: 40%;
            min-width: 300px;
        }

        /* Fifth column takes remaining space */
        th:nth-child(5),
        td:nth-child(5) {
            width: 25%;
            min-width: 150px;
        }

        /* Enable horizontal scroll only for small screens */
        @media screen and (max-width: 768px) {
            .table-container {
                overflow-x: auto;
            }
        }

        /* Three side-by-side divs with ellipsis inside third column */
        .three-divs-container {
            display: flex;
            gap: 10px;
            min-width: 100%;
        }

        .three-divs-container .box {
            flex: 1;
            min-width: 80px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            border: 1px solid #ccc;
            padding: 10px;
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="table-container">
            <table>
                <thead>
                    <tr>
                        <th>First Column</th>
                        <th>Second</th>
                        <th>Third Column</th>
                        <th>Fourth Column</th>
                        <th>Fifth Column</th>
                        <th>Sixth</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(row, index) in tableData" :key="index">
                        <td :title="row.first">{{ row.first }}</td>
                        <td>{{ row.second }}</td>
                        <td>{{ row.newColumn }}</td>
                        <td>
                            <div class="three-divs-container">
                                <div class="box" title="This is some long text that will be truncated">Department texts
                                    goes here</div>
                                <div class="box" title="This is some long text that will be truncated">Director of
                                    Sales
                                    and Marketing (Marketing & Advertising)</div>
                                <div class="box" title="Another long text that needs ellipsis">Codemoly</div>
                                <div class="box" title="Short text">15.5 years</div>
                            </div>
                        </td>
                        <td :title="row.fourth">{{ row.fourth }}</td>
                        <td>{{ row.sixth }}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <script>
        new Vue({
            el: "#app",
            data: {
                tableData: [
                    { first: "LongTextExampleThatWillBeTruncated", second: "100", newColumn: "NewData1", third: "VeryLongTextThatShouldTruncate", fourth: "AnotherLongTextThatNeedsEllipsis", sixth: "200" },
                    { first: "ShortText", second: "101", newColumn: "NewData2", third: "Data3", fourth: "Data4", sixth: "201" },
                    { first: "AnotherLongTextExampleThatExceedsLimit", second: "102", newColumn: "NewData3", third: "MoreTextThatNeedsToBeShortened", fourth: "EvenLongerTextThatMustBeCut", sixth: "202" }
                ]
            }
        });
    </script>
</body>

</html>

here is the output of this:

enter image description here

The problem here is that the fifth column is having so many empty spaces on its right. In this scenario, I want to want the fourth column to take more spaces so that it can show its texts more.

Summary:
Trying to show as much as texts I can, on these columns. If this table is opened with ultra wide monitor, all columns should show full texts. for smaller devices like mobile, it should show a horizontal scrollbar. Vanilla javascript example is also welcome

Header position sticky doesn’t work in any browser

I’m working on this project and want the header to be sticked to the top when it’s scrolled up. Currently it’s positioned under row_1 so when it scrolls up it should stick. The problem is, it doesn’t no matter how hard I tried to solve this. Please if anyone can have a look at the code and tell me what’s wrong it’ll be hugely appreciated.

Thanks !!

<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet"><script>
  // Adjust header size on scroll (Desktop Only)
  window.addEventListener("scroll", function () {
    if (window.innerWidth > 768) {
      const header = document.querySelector(".header");
      const linked = document.querySelector(".linked");
      const navContent = document.querySelector(".nav-content");

      if (window.scrollY > 50) {
        header.style.height = "7vh"; // Reduce header height
        linked.style.width = "30%"; // Scale down logo width
        navContent.style.height = "100%";
      } else {
        header.style.height = "11vh"; // Reset header height
        linked.style.width = "50%"; // Reset logo width
        navContent.style.height = "100%";
      }
    }
  });
document.addEventListener("DOMContentLoaded", function () {
    const header = document.getElementById("header");
    const smallLogo = document.querySelector(".small-logo");
    const bigLogo = document.querySelector(".big-logo");

    let lastScrollY = window.scrollY;

    function handleScroll() {
        const currentScrollY = window.scrollY;

        if (currentScrollY > lastScrollY) {
            // Scrolling down - Hide big logo, show small logo
            bigLogo.style.opacity = "0";
            smallLogo.style.opacity = "1";
        } else {
            // Scrolling up - Show big logo, hide small logo
            bigLogo.style.opacity = "1";
            smallLogo.style.opacity = "0";
        }

        lastScrollY = currentScrollY;
    }

    window.addEventListener("scroll", handleScroll);
});
[id="P0716828012"].page {   
    width: 100%;
    height: auto%;
    animation: fadeInAnimation ease 3s;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
        pointer-events: auto;

    
}
@keyframes fadeInAnimation {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
.page-content{
    padding: 0;
}
.flex_container{
    display: block;
     height: auto;
}
/* General Header Styling */


.header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 11vh;
   position: sticky !important;
    top: 0;
    z-index: 10;
    transition: height 0.5s ease-in-out;
        background: linear-gradient(180deg, #FF7B42 0%, #F2A1FF 100%);    

}

.logo-container {
    height: 100%;
    flex: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: clip;
    transition: transform 0.5s ease-in-out;
}


.big-logo {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    width: 100%;
}

/* Small logo (only visible when header sticks) */
.small-logo {
    opacity: 0;
    position: absolute;
    transform: translateY(20px); /* Start slightly below */
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    width: 25% !important;
        filter: brightness(0) saturate(100%) invert(96%) sepia(24%) saturate(3664%) hue-rotate(6deg) brightness(107%) contrast(103%);

}



/* When header becomes sticky */
.header .scrolled .big-logo {
    opacity: 0 !important;
    transform: scale(1.1) translateY(-10px);
} 

.header .scrolled .small-logo {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.background{
    position: absolute;
    z-index: 0;
    width: 100%;
}
.upper{
    z-index:1;
    width: auto;
    display: flex;
    flex-direction: column;
}
.big_logo{
    z-index: 1;
    margin-top: 2vw;
    width: 100%;
    justify-items: center;
}

.underlogo{
    display: flex;
    flex-direction: row;
        margin-top: 2vw;
    width: 100%;
    justify-content: space-between;
    z-index: 1;
    justify-items: center;
}
<div class="flex_container"><div class="flex_container">
<div class="body" style="margin-top: 0px;">
<div class="animate__animated animate__slideInUp row_1"><div class="upper">
  <div class="animate__animated animate__slideInUp big_logo"><media-item class="linked_1" disable-zoom="true" hash="A2055381632570752028865218862056" rel="history"></media-item></div>
  <div class="animate__animated animate__slideInUp underlogo">
    <h2><span class="h2_4">Private Studios,<br>7 days a week.</span></h2>
  <h2><span class="h2_4">Your dedicated space to<br>practice, create, and grow.</span></h2></div></div>
  <div class="animate__animated animate__slideInUp cta"><span class="button4">BOOK NOW</span></div>
  <div class="animate__animated animate__slideInUp background"><media-item class="globe-1" disable-zoom="true" hash="C2245897288951030710025741786088"></media-item>
  </div>
  </div><div class="header" id="header" style="height: 11vh;">
  <div class="logo-container">
        <!-- Default big logo -->
        <media-item class="small-logo" disable-zoom="true" hash="A2055381632570752028865218862056" href="main" rel="history"></media-item>

        <!-- Small sticky logo (Hidden initially) -->
        <media-item class="big-logo" disable-zoom="true" hash="L2249700064765940012273777892328" href="main" rel="history" width="100%"></media-item>
  </div><button class="animate__animated animate__slideInUp menu-toggle" onclick="toggleNavbar()">☰</button><div class="nav-content" id="nav-content" style="transform: scale(1); display: none; height: 100%;">
            <div class="animate__animated animate__slideInUp section section1"><a class="button button1" href="estrelar-u" rel="history">ESTRELAR U</a></div>
            <div class="animate__animated animate__slideInUp section section2"><a class="button button2" href="shop">SHOP</a></div>
            <div class="animate__animated animate__slideInUp section section3"><a class="button button3" href="faq">FAQs</a></div>
        </div></div></div>
        
  
        </div>

How do I return Error with non-integer parameters? [duplicate]

const sumAll = function(x, y) {
  let sum = 0;

if (x < 0 || y< 0 || isNaN(x) ||  isNaN(y) || Number(x) !== x || Number(y) !== y ) {
    return "ERROR";
  } else {    if (x > y) {
      for (let i = y; i <= x; i++) {
        sum += i;
      }
      return sum;
    } else {      for (let i = x; i <= y; i++) {
        sum += i;
      }
      return sum;
    }
  }
};

Hello, having some issues im stuck.

How do I return Error with non-integer parameter?

Building a string with substrings at specified locations

I have 2 substrings, const string1 = '1111'; const string2 = '2222'; .

I want to build a string where the first 4 indexes are empty , string1 occupying 5th to 10th index and then later followed by string 2.

I am expecting the output as : " 1111 2222" as we can see the first 4 places are blank and string2 starts from 11th position .

This is what I have tried :

function StringExtract() {
    const string1 = '1111';
    const string2 = '2222';
    const stringWithSUbStrings = new Array();

    for (let i = 0; i < string1.length; i++) {
        stringWithSUbStrings[5 + i] = string1[i];
    }

    for (let i = 0; i < string2.length; i++) {
        stringWithSUbStrings[10 + i] = string2[i];
    }
    return stringWithSUbStrings;
}
console.log(StringExtract());

unable to read a file from angular and pass it to API built using java

I have application where I am using angular. Input a csv file and add the file to form.
below is the code used

var fileInput = document.getElementById('chosenFile');
    var fd = new FormData();
    fd.append('fileMetadata', JSON.stringify(imgMetadata));
    var file = fileInput.files[0];
    fd.append('file', file);

now I call http post to send file to my server,

enter code here

$http.post(uploadurl, fd, {
               transformRequest: angular.identity,
               transformResponse: angular.identity,
               headers: {
                  "X-XSRF-TOKEN": PluginHelper.getCsrfToken(),
                  "Content-Type": undefined
               }
            }).then(function successCallback(response) {
        console.log("In success callback");
        var status = response.status;
        if(status == "200")
        {
            var isValid = response.data;
            console.log("FIleupload function in java "+isValid);
            if(isValid == "filecopied")
            {
                
                
                $scope.errorText = "filecopied :";
            }
            
        }
    }, function errorCallback(response) {
        console.log("In error callback");
        $scope.errorText = "Error in callback file function";
        
    });

At my server end I have written java code to read the file.

 @POST
    @Path("/uploadfile/{csvdata}")
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    @AllowAll
    public Response uploadfile(@PathParam("csvdata") String csvdata, @FormDataParam("fileMetadata") String fileMetadata,
      @FormDataParam("file") InputStream uploadedInputStream,
      @FormDataParam("file") FormDataContentDisposition fileDetail, FormDataMultiPart multiPartData, @FormDataParam("fd") InputStream formdata) throws Exception {
      try {
        if (uploadedInputStream == null) {
          log.error("Error: uploadedInputStream is null");
          //return Response.status(Response.Status.BAD_REQUEST).entity("File input stream is null").build();
        }
        if (formdata == null) {
          log.error("Error: formdata is null");
          //return Response.status(Response.Status.BAD_REQUEST).entity("File input stream is null").build();
        } else {
          log.error("Error: formdata is NOT null");
        }
        // for file field    
        final FormDataBodyPart filePart = multiPartData.getField("<file_field_name>");
        final ContentDisposition fileDetails = filePart.getContentDisposition();
        final InputStream fileInputStream = filePart.getValueAs(InputStream.class);
        log.error(filePart + "-" + fileDetails + "--" + fileInputStream);
        log.error("TRY FILEUPLOAD: " + csvdata);
        log.error("File Metadata: " + fileMetadata);
        // Process the uploaded file
        String uploadedFileLocation = "d://uploaded/" + fileDetail.getFileName();
        log.error("uploadedFileLocation: " + uploadedFileLocation);
        log.error("fileDetail: " + fileDetail.getSize());
        saveToFile(uploadedInputStream, uploadedFileLocation);
        return Response.status(Response.Status.OK).entity("filecopied").build();
    
      } catch (Exception e) {
        log.error("catch uploadfile: " + e.toString() + "-" + e.getMessage());
        return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Cannot copy!!").build();
    
      }
    
    }
    private void saveToFile(InputStream uploadedInputStream, String target) {
      try (OutputStream out = new FileOutputStream(new File(target))) {
        log.error("TRY saveToFile");
        int read;
        byte[] bytes = new byte[1024];
        while ((read = uploadedInputStream.read(bytes)) != -1) {
          out.write(bytes, 0, read);
        }
      } catch (IOException e) {
        log.error("catch saveToFile: " + e.toString() + "-" + e.getMessage());
      }
    }

if you see parameters of the method,

1-@PathParam("csvdata") String csvdata, @FormDataParam("fileMetadata") String fileMetadata,
2-@FormDataParam("file") InputStream uploadedInputStream,
3-@FormDataParam("file") FormDataContentDisposition fileDetail,FormDataMultiPart 
4-multiPartData,@FormDataParam("fd") InputStream formdata

I have tried above options but uploadedInputStream and InputStream comes always null.
i am able to get
csvdata
fileDetail
fileMetadata

but i am unable to get file from xhtml to java API.
Need help in reading file from form .

I have tried passing multiple parameters at java code but no luck.

Sample output i get is
uploadedInputStream is null
formdata is null
catch uploadfile: java.lang.NullPointerException-null

How to add months to a date in Javascript whilst keeping the ‘day’ portion consistent [duplicate]

I know the general question ‘How to add months to a date in JS’ has been asked many a time before, however I can’t seem to find a scenario specifically like mine.

I have a portion of a function which calculates the dates between payments in a payment arrangement schedule. When ‘monthly’ is selected in the form, and the day portion of the date does not exist for the next month, I require that the next payment date be the last day of the next month. This part was fine, however I then need the schedule to return to the original day for the month following (provided it exists in that month).

e.g. 31/01/2026 should roll down into 28/02/2026 and then go back to 31/03/2026 and then 30/04/2026 etc.

My current code is below, as you can tell it just works out what the next date will be by adding to the month and then calculates the days between the current payment date it’s at and the next one so it can calculate interest and such for that many days. The issue is if the day doesn’t exist it rolls over to the next month (30/01/2026 -> 02/03/2026).

let periodDays;
if (frequency === 'weekly') {
    periodDays = 7;
} else if (frequency === 'fortnightly') {
    periodDays = 14;
} else if (frequency === 'monthly') {
    let nextMonth = new Date(startDate);
    nextMonth.setMonth(startDate.getMonth() + 1);
    periodDays = Math.round((nextMonth - startDate) / (1000 * 60 * 60 * 24));
}

Edit: Seems that my question is flagged as similar to another which is asking how to get the last day of the month. That part I have no problem with (see below attempt), it’s that once it rolls down to 28 or 30 or whatever I can’t get it to return to the original day for the months following (if exists).

} else if (frequency === 'monthly') {
    let nextMonth = new Date(startDate);
    let targetMonth = startDate.getMonth() + 1;

    nextMonth.setMonth(targetMonth);

    // If month overflows, fix it by setting to last valid day of intended month
    if (nextMonth.getMonth() !== targetMonth % 12) {
        nextMonth.setDate(0); // Moves to last day of previous month
    }

    periodDays = Math.round((nextMonth - startDate) / (1000 * 60 * 60 * 24));
}

How to add months to date in Javascript with special conditions

I know the general question ‘How to add months to a date in JS’ has been asked many a time before, however I can’t seem to find a scenario specifically like mine.

I have a portion of a function which calculates the dates between payments in a payment arrangement schedule. When ‘monthly’ is selected in the form, and the day portion of the date does not exist for the next month, I require that the next payment date be the last day of the next month. This part was fine, however I then need the schedule to return to the original day for the month following (provided it exists in that month).

e.g. 31/01/2026 should roll down into 28/02/2026 and then go back to 31/03/2026 and then 30/04/2026 etc.

My current code is below, as you can tell it just works out what the next date will be by adding to the month and then calculates the days between the current payment date it’s at and the next one so it can calculate interest and such for that many days. The issue is if the day doesn’t exist it rolls over to the next month (30/01/2026 -> 02/03/2026).

let periodDays;
if (frequency === 'weekly') {
    periodDays = 7;
} else if (frequency === 'fortnightly') {
    periodDays = 14;
} else if (frequency === 'monthly') {
    let nextMonth = new Date(startDate);
    nextMonth.setMonth(startDate.getMonth() + 1);
    periodDays = Math.round((nextMonth - startDate) / (1000 * 60 * 60 * 24));
}

Menu expand transition with dynamic max-height

I have a website header with an expandable menu (in mobile screen widths) that operates very similarly to the example listed below:

document.addEventListener("DOMContentLoaded", function () {
    const menuButton = document.getElementById("menu-button");
    const menu = document.getElementById("menu");

    menuButton.addEventListener("click", function () {
        menu.classList.toggle("open");
    });
});
body {
    margin: 0;
    padding: 0;
}
header {
    background-color: #333;
    color: #fff;
    padding: 0 1rem;
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.menu {
    background-color: #888;
    position: absolute;
    top: 80px;
    left: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
    max-height: 0;
    overflow: hidden;
    transition: max-height 3s;
}
.menu.open {
    max-height: 100vh;
}
.menu-item {
    list-style-type: none;
}
.menu-item:not(:last-child) {
    border-bottom: 1px solid #333;
}
.menu-item a {
    display: block;
    padding: 1rem;
    color: #fff;
}
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Test Document</title>
    </head>
    <body>
        <header class="drop-shadow">
            <nav class="container">
                <!-- Logo -->
                <h2>LOGO</h2>

                <!-- Menu Button -->
                <button id="menu-button" class="menu-button">☰</button>

                <!-- Menu -->
                <ul id="menu" class="menu">
                    <li class="menu-item">
                        <a href="/" class="menu-link active">Home</a>
                    </li>
                    <li class="menu-item">
                        <a href="/blog" class="menu-link">Blog</a>
                    </li>
                    <li class="menu-item">
                        <a href="/about" class="menu-link">About</a>
                    </li>
                </ul>
            </nav>
        </header>
    </body>
</html>

The issue is that while the menu opens instantly upon clicking, the max-height is greater than the actual height and therefore when collapsing, it takes a moment before the menu can be visibly seen collapsing.

I know that a common solution is to dynamically add the max-height using javascript. But the problem here is that it adds the max-height via inline styling on the element. The menu on my actual site is responsive to screen width, and always visible on larger screen screens. So if the window size is expanded after the menu is toggled, inline max-height styling messes the whole thing up.

I don’t want to hardcode the max-height, as the menu items (and consequently the max-height) will be regularly changing.

Is there a way to ensure instant visible collapsing of the menu without dynamically adding max-height via in-line styling? (I hope this all makes sense)

TypeError: can’t access property “globalProperties”, app.config is undefined error in Quasar project

I’m working on a Vue 3 + Quasar project, and I’m trying to integrate Pinia Colada for request deduplication and automatic caching. After trying to register the plugin pinia.use(PiniaColada) in the store setup src/stores/index.ts, I get the error ‘TypeError: can’t access property “globalProperties”, app.config is undefined’:

import { createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import { PiniaColada } from '@pinia/colada';

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
pinia.use(PiniaColada);  // This line causes the error

export default pinia;

I’m looking for a possible solution.

How to make elements in an array display as one word?

I am creating a random password generator. One of the arrays contains all of the elements, in order, in order to create the password, and I don’t know how to do that in a way that it would be applicable to all password lengths.

ultimateRandomPassword (name of array) = [‘q’, ‘%’, ‘8’, ‘v’, ‘o’, ‘F’, ‘A’, ‘M’, ‘Y’, ‘9’] => q%8voFAMY9 (for output)

I wanted to do console.log(ultimateRandomPassword[1] + ultimateRandomPassword[2]…), but I know that would be incredibly inefficient, and also would only apply to a specific number of elements in the array.

Firebase + Javascript web app: Uncaught FirebaseError: Firebase: Need to provide options, when not being deployed to hosting via source

I recently tried to make a bare bones test for a live http site that reflects realtime data from Firebase Firestore.

I was able to do it successfully but not until I had manually defined my projects credientials inside index.html like this:

const firebaseConfig = {
  apiKey: "cIzfosDnSXjxD7zfd65YjhdjQdfrWHLoLosKDY",
  authDomain: "blah.firebaseapp.com",
  projectId: "blah-blah",
  storageBucket: "blah.firebasestorage.app",
  messagingSenderId: "221429889262",
  appId: "2:4014441154862:web:c02442acD4363ed77c6f2b"
};

But I was under the impression that this is not necessary if you are deploying using Firebase CLI (which I am doing) and that you can just use

    const app = initializeApp();

with no arguments instead of

    const app = initializeApp(firebaseConfig);

So I was expecting that Firebase CLI would take care of this by itself since it knows what firebase project the code is associated with.

But if I use no arguments and test it using the live site (not the firebase emulator or direct local load) I get an error in the javascript console of the browser effectively saying “initializeApp needs to have arguments” —

api.ts:146 Uncaught FirebaseError: Firebase: Need to provide options, when not being deployed to hosting via source. (app/no-options).
at initializeApp (api.ts:146:25)
at (index):19:21″

But I am “deploying to hosting via source” am I not?

Use XMLHttpRequest to replace contents of div after form submit?

I have an html form that filters a list of results in a div.

What I want is that only the contents of the div are reloaded instead of the whole page, and only using vanilla javascript.

This is what I have so far and is not quite working:

document.querySelector('form[name="filters"]').addEventListener('submit', function (e) {
    
    e.preventDefault();
    var xhttp = new XMLHttpRequest();
    var action = document.querySelector('form[name="filters"]').getAttribute('action');
    var list = document.querySelector('.list');
    xhttp.responseType = "document";
    xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
          list.innerHTML = this.response.querySelector('.list').innerHTML;
        };
    };
    xhttp.open("POST", action, true);
    xhttp.send();

});

React-Leaflet Focus on Click

Subject: Map Dragging Causes Unexpected Focus/Pop-Out

Problem:

My map (within a card) in my GTAV LiveMap project “pops out” or gains focus when I click and drag. I want it to drag smoothly without this behavior.

What I’ve Tried:

  • Checked focus event listeners.
  • Disabled potential CSS focus styles.
  • Attempted to prevent default mouse down actions.

Question:

How do I stop the map from gaining focus/popping out when dragging?

https://s6.ezgif.com/tmp/ezgif-685a304bd7b0b3.gif

interface MapProps {
  zoom: number;
}

export function Map({ zoom }: MapProps) {
  const [spawnData, setSpawnData] = useState<SpawnData[]>([]);

  return (
    <MapContainer
      crs={CUSTOM_CRS}
      minZoom={2}
      maxZoom={5}
      preferCanvas={true}
      center={[-900, 200]}
      zoom={zoom}
      style={{
        width: "100%",
        height: "100%",
        background: "#0fa8d2",
        overflow: "hidden",
      }} // Add overflow hidden
      attributionControl={false}
      zoomControl={false}
    >
      <TileLayer url="/{z}/{x}/{y}.jpg" />

      {spawnData.map((item, i) => (
        <Marker key={i} position={[item.y, item.x]}>
          <Popup>
            <div className="popup-title">{item.label}</div>
          </Popup>
        </Marker>
      ))}
    </MapContainer>
  );
}
<Card
                className={cn(
                  "overflow-hidden transition-all duration-300",
                  mapExpanded ? "h-[600px]" : "h-[400px]"
                )}
              >
                <CardHeader className="pb-2 flex flex-row items-center justify-between">
                  <div className="flex items-center gap-2">
                    {/* Zoom Out Button */}
                    <Button
                      variant="outline"
                      size="icon"
                      className="h-8 w-8 bg-gray-800/50 border-gray-700"
                      onClick={zoomOut}
                    >
                      <ZoomOut className="h-4 w-4" />
                    </Button>

                    {/* Zoom In Button */}
                    <Button
                      variant="outline"
                      size="icon"
                      className="h-8 w-8 bg-gray-800/50 border-gray-700"
                      onClick={zoomIn}
                    >
                      <ZoomIn className="h-4 w-4" />
                    </Button>

                    {/* Expand/Collapse Button */}
                    <Button
                      variant="outline"
                      size="icon"
                      className="h-8 w-8 bg-gray-800/50 border-gray-700"
                      onClick={() => setMapExpanded(!mapExpanded)}
                    >
                      {mapExpanded ? (
                        <Minimize2 className="h-4 w-4" />
                      ) : (
                        <Maximize2 className="h-4 w-4" />
                      )}
                    </Button>
                  </div>
                </CardHeader>

                <CardContent className="p-0 relative h-full overflow-hidden">
                  {/* Pass zoom state and handlers as props to the Map component */}
                  <Map zoom={zoom} />
                </CardContent>
              </Card>

Why is position: sticky not working for the panel but works for the table header and rows?

I am trying to add a shadow effect using ::after on a sticky element inside a flex container, but it is not working as expected. Instead, it overrides the main table.

When I use position: relative; and position: absolute;, the shadow appears, but only after scrolling horizontally. I need it to behave like the sticky elements in my table header and rows, which remain visible while scrolling.

The same approach works for the header and rows but not for the panel. How can I achieve the same sticky shadow effect for the panel?

  const CollapseWrapper = styled.div`
  display: flex;
  background-color: #cacaca;
  border-bottom: 1px solid black;
  user-select: none;
  width: 1750px;
  ::after {
    content: "";
    position: fixed;
    width: 140px;
    height: 100%;
    right: 0;
    top: 0;
    pointer-events: none;
    box-shadow: -3px 0px 4px -2px rgba(0, 0, 0, 0.45);
  }
`;

Codesandbox Reference [https://codesandbox.io/p/sandbox/busy-nightingale-pxcf5j]

Problem look at the right side just below price there should be box shadow
enter image description here
Expected Output
enter image description here