Relative Content

Tag Archive for javascriptcss

Setting width of table element not working in Javascript

I have a two-dimensional data grid where I have a header row in one table and multiple lines of data in a table directly underneath (they need to be in separate tables). I need the width of a header element to adjust itself to the width of the data element if the data element is wider, and the width of the data element to adjust itself to the width of the header element if the header element is wider. Problem is, it’s not setting the widths correctly.

Inserting HTML elements and attributes into the DOM using JS

I have the following JS code to create a grid of squares. It isn’t creating a grid so much as a single column. Using the Chrome developer tools, I drilled down into the DOM to find the parent container to see whether the two attributes (grid-template-rows and grid-template-columns) were being inserted. They are, but, their values are enclosed in quotes leading me to think that they’re actually being ignored by browser. Note that other CSS statements are styling the boxes and setting positions.

carousel slider pure js

I need to do a carousel slider of rewiews from this maket: https://www.figma.com/proto/WKFG4SvIHfjELwFsrtCjZD/%D0%B0%D0%B2%D1%82%D0%BE%D1%88%D0%BA%D0%BE%D0%BB%D0%B0?node-id=0-1&viewport=-354%2C-167%2C0.13&t=1PR5Ev17pLz3WT3O-0&scaling=scale-down&content-scaling=fixed&starting-point-node-id=19.
i have some code written by chat gpt, but it works incorrectly. I’m a newbie js, so it would be good if you explained what the problem is and solved it.
I need to do this slider in pure js.
Thanks in advance)