LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2007, 09:47 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
HTML tables and css


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 for your help.
 
Old 11-14-2007, 10:02 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Read the CSS documentation at http://www.w3.org/Style/CSS/

[removed link]

Last edited by crabboy; 11-14-2007 at 09:45 PM. Reason: Removed spamming link
 
Old 11-14-2007, 11:50 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
If I remember correctly, CSS won't handle every variable that can be applied to tables.

An editor like Bluefish is very handy for reminding you what you can and cannot do in various situations.
 
Old 11-15-2007, 12:29 AM   #4
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
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.

Last edited by rblampain; 11-15-2007 at 01:19 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML/CSS/JS: Problem with <p> not having an absolute position with CSS. RHLinuxGUY Programming 7 03-03-2007 12:21 AM
CSS and nested tables Tinkster Programming 5 03-13-2006 02:07 PM
A little HTML/CSS help? jon_k General 9 07-17-2005 01:49 AM
html/css retrodict Programming 5 11-01-2004 06:56 PM
html/css hylke Programming 0 06-27-2004 02:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration