[HTML] / [CSS] multiple width's in one table


OSNN Veteran Addict
6 Mar 2002
I am currently making a news page, for my Songviewer webpage. Each news item contains 3 parts, as you can see in this working example, the date/posted by, title and message body. I have created 4 example news items, which all are in one table. I have decided, to make them stand out better, that both the title and message body get a border and a background color (the colors on the working example are there only for the test, don't brag about it). All nice and well, but I want the width of the title bar to be smaller than the message width. With smaller I mean just as wide as the title-text.

I can think of one option: Use multiple tables for one message, ie creating a table for the date/posted by, one table for the title and one for the message. The width for the title-table is calculated by a PHP script (strlen($text) * font-width) which is put in a style="width : <title width>;". But I don't want that, because that would make my page be cluttered with tables.

Does anyone know of a way by doing this with HTML or CSS or should I use PHP instead?


OSNN Newbie
6 Jan 2004
I added a class (border, background-color, etc) on the title-text, instead of the td.
Probably not what you want, but it's all I can think of right now.


  • test.zip
    757 bytes · Views: 59

Members online

No members online now.

Latest profile posts

Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!
Perris Calderon wrote on Electronic Punk's profile.
EP, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there!

Forum statistics

Latest member