Jump to content

HTML&CSS | How to avoid overflowing text on table with background no matter how long the text is

Go to solution Solved by duncannah,
table-layout: fixed;

on the table element keeps the columns at the same size, don't forget to give it a width property also

Hi everyone,

I'm trying to make a table to display information but I can't get the table display to stay in a fixed size instead of moving when text is introduced:
--> What would be the text property so that the grey table is not enlarged? (the one with arrows)
I would like the first bar (0 - 4 i dont want this to overflow...) to be the same size as the other 3 on the right no matter how long the text is.
Thank you very much!
 

image.thumb.png.c346bf84bba5fa7508fabe9d73e9fece.png

Link to comment
Share on other sites

Link to post
Share on other sites

table-layout: fixed;

on the table element keeps the columns at the same size, don't forget to give it a width property also

🙂

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you!!
I was stuck searching on forums but didn't get google to show me that text property.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×