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


OSNN Veteran Addict
Mar 6, 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
Jan 6, 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.


Members online

No members online now.

Latest profile posts

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 comming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier, mine is perriscalderon at gmail
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 https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...

Forum statistics

Latest member