Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format a column of table cells

Status
Not open for further replies.

leegold2

Technical User
Oct 10, 2004
116
0
0
I'm looping through a DB and displaying a "shaved down" brief display of each record in tabular format via HTMl tables. For one particular field (ie. table cell) I do:

$table_content = substr($full_content, 0, 170);

With that I am selecting the first 170 characters of content which I then put into the table cell with the link "...more" tagged onto the end - which links to a specific detail page for that record.

My question is I want to try and format this column of cells. Even though I'm putting in the same number of chars into each table cell, it seems because of word breaking I don't get a consistent "look". For example, if I had a 150 character word in one cell it would stretch the table column way out of "wack". Is there an intelligent way to format a column of table cells or maybe a way to break long words to get a consistant look in that column. Either via CSS, HTML or PHP?

Thanks
 
that's useful knowledge - one that i haven't come across before!

would you then recommend outputting the result in html using nl2br(0) or with preformatted tags?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top