in Education by
What I'm trying to do should be something extremly simple but still I cannot seem to get it done right with Material UI (ReactJS): I have a Card element that shows some image, a title, a description and some buttons. This element has a FIXED width and height. I want to display N amount of this elements, one after each other, inside a container element who's WIDTH may vary. So, if the container element's width is 1000px and the Card elements are 250px, it will dispaly 4 Card elements in a row. And if I then set a width of 500px for the container, it should display 2 Card elements in a row and the other 2 below in a new row. About a decade ago when I was still doing html+css I used to do this using a DIV with a specific width and some other floated DIVs inside -also with fixed width- and it would render in this way I explained... I mean, the "overflow" from a row would automatcally go to the row below. I have tried many different things, I also searched for photo album tutorials and things like that and still can't get it done... How am I supposed to do this kind of things with Material UI and ReactJS? Thanks in advance! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can deal with these kinds of problems using flex-box. Here I did a simple example just using a couple of properties that should fit our description: https://codesandbox.io/s/throbbing-cdn-cbb6mx?file=/src/App.js In this link, you can find a very nice guide about flex-box: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Related questions

0 votes
    I have a google map set with the Javascript API V3. It's displayed in a div with a dynamic width ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I have a google map set with the Javascript API V3. It's displayed in a div with a dynamic width ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    This is part of the component : import MyComp from '../../lib/MyComp' const Data = ( { data } ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    This is part of the component : import MyComp from '../../lib/MyComp' const Data = ( { data } ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm using Semantic-UI-React in my React/Rails project and trying to use a Form.Select drop down ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I'm using Semantic-UI-React in my React/Rails project and trying to use a Form.Select drop down ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    What is the virtual DOM? How does react use the virtual DOM to render the UI?...
asked Dec 5, 2020 in Technology by JackTerrance
0 votes
    So I have a Nginx running inside a docker container, I have a mysql running on the host system, I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    What command is used to go inside a running container? 1. docker sh 2. docker exec -it sh 3. docker access 4. docker ps -a...
asked Jun 22, 2021 in Technology by JackTerrance
0 votes
    I can't solve this for almost four hours, and i can't find any helpful documentation for this ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    Hello All,I am using react-navigation v3 for navigation purposes.I have created a tab navigator called ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 30, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 13, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: How to remove the space between inline/inline-block elements? (41 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: How to remove the space between inline/inline-block elements? (41 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
...