Glaanieboy
OSNN Veteran Addict
- Joined
- 6 Mar 2002
- Messages
- 2,628
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?
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?