ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a casual CSS user.
I had a table that did not work as expected because the browser adds the width of the widest cells in various rows to render the table and this occasionally created an overflow that triggers a completely unwanted scrollbar.
The solution is, I think, to make each row of my old table a table in itself but I need the cells that are containing text to be only expandable to the width of the text, plus small margins, which is sometime a single word and I need these cells to occupy only a portion of the available width.
If there is only one cell containing text in a row, I need it to use 66% of the available width at the most and have the remaining width spread evenly between a cell on the left and one on the right.
If I have 2 cells that have text, I need them to have at least an empty cell of 20% of the width between them.
And if there is 3 cells with text (the maximum), I need them to have a cell of 16 pixels between them.
Also, these tables should appear as a single table, the first table should have a top border as well as a left and right border, but no bottom border. The last cell should have a bottom border as well as a left and right border. And the tables in the middle should only have a left and a right border.
My question: what is the best way to obtain this result with CSS?
A few examples will probably save me days of trials and errors.
Thank you to pixellani, that's probably my biggest problem, to know what is doable. I never thought an editor could help in that regard. I'll follow your suggestion.
If someone could tell me what is not doable in CSS from what I explained above, that will be a big help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.