displaying something in table problem
I was practicing php CRUD, I figured it out that it was the css fault when I try to configure it
here is the html structure
even the browser dev tool shows me this html structure
and here is my css
other table css properties that I might have overlooked
25 Replies
You have an error in this line:
<td><a href="./user_remover.php"> ">X</a></td>
ah, but removing that doesn't resolve the issue.... I will take a closer look....Oh that part, I just mistyped it because I was removing php codes there
Its on the css
Ive tried moving away the child targetjng properties and they work
you're resetting the display property of a TD, that's not something you should do
that is overwriting the standard display value of
table-cell
, and breaking the tableSo how do I approach it?
What are you trying to do in those cells? Why do you need flex?
wrap the buttons, or use some other method to center them
Its to center the link haha
text-align works just fine
No, its the button style that I want to maintain
But I didn't think it would break the table
then style the A tags, not the TD
put some padding on there or something
Okay I'll try it now
adding
display: inline-block;
to your <a> selectors will them to take the height and width that you have defined.
defining width and height on an inline element won't do anything.Yeah It did maintain its size, but now I can't apply flex to it
why do you need flex? Are youn going to add more content to the buttons?
Aint no way
It centered it
you mean text-align? Yeah, it's an inline element even with
display: inline-block;
Its how I approach when it comes to centering things, I guess I need to change it
Yes, I guess I ignored the definition or something, I heard it before
you need multiple tools in your toolbox. This just wasn't the right one for this situation
Thanks for the help, new core memory unlocked haha
You could also simplify your css code.
There is a lot of repetition in there.
For example if both of the links have the same styling except for the color, you can define them both with one selector.
Then, in your "hover" selectors, you don't need to re-define things that haven't change. In this case the hover states really only need to define the background color.
Here is a condensed version of that part of the CSS to hopefully demonstrate what I am saying:
Thanks, about something like this, I also had practiced it but still left me doing the "redefining" on a small amount because sometimes property disappear, but I do had it in mind, its just this project is a practice thats why I had gone overkill haha
How do I tag this to solved? I dont know how
you can edit tags and add "solved"
on PC it's the three dots in the top right
Ah I got it now
Thank you very much sirs, for the help