PDA

View Full Version : Fixed width last post table cell


squishi
06-03-2009, 05:46 AM
I am unable to assign a fixed width to the table cells that contain the last post info.

I've already tried to give both the table cell (td) in the first row and all other rows a certain css attribute ("style='width:200px'").
When the page is loaded, those cells collapse to the width that is determined by their text content.
How do I expand those cells so that they all have the same width?

Dismounted
06-03-2009, 06:17 AM
Just modify the header row to have a static width. Also, try using just the width attribute (i.e. not using a style attribute with CSS).

squishi
06-04-2009, 03:43 AM
I have a fairly good understanding of html. I've tried doing what you said (mentioned it in the original post already), but it did not work.
So I guess I must be overlooking something.

Here is the template contents that control the width of the header row:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr align="center">
<td class="thead" width="100%" align="$stylevar[left]">

<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
<if condition="$show['forumdescription']"><span class="smallfont">- $forum[description]</span></if>

</td>

<td class="thead" width="175">$vbphrase[last_post]</td>

<td class="thead">$vbphrase[posts]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="thead">$vbphrase[moderator]</td>
</if>
</tr>
</thead>

The width of 175 is added to the last post section in the table's header row, but it is not applied in the browser. Adding a css style instead of the width attribute does not work, either.

The only reason that I can think of is the width of 100% in the preceding table cell?

Lynne
06-04-2009, 03:52 AM
Check vboptions > forum display > last thread title max chars and set that smaller. If you have it too long, it will push that table cell width out no matter what you have it set to.

squishi
06-04-2009, 03:26 PM
But table cells that are smaller than the 175 px are not expanded!

Lynne
06-04-2009, 04:12 PM
They are in that particular table. You separated the tables. When you do that, what happens in one table will no effect the other table. Nothing you can do about it if you are going to keep the tables separated.

squishi
06-04-2009, 04:47 PM
I know the tables are separated.
But if I add the width to all the table cells, they should expand.
Anybody know the reason why they don't do that?

Lynne
06-04-2009, 04:59 PM
How about a link to your page so we can see what is going on? and a test account if needed.

And if you have another table cell with a width in there, it could be conflicting with this one and that is the problem you are seeing.

squishi
06-07-2009, 04:00 PM
**** link removed ****

The width of course depends on the latest post in the forum.
Both the table header and the last post table cell itself have a width attribute of 220.

Could it be all the "white-space:nowrap" stuff that collapses the table cell?

Lynne
06-07-2009, 04:51 PM
Have you tried setting it to something bigger like 250? What do you have vboptions > forum listings options > last thread title max chars

squishi
06-07-2009, 05:19 PM
Max chars is 30.

The width of 220 is about the width of the largest last post table cell.
The smallest one I currently have showing is about 150px.

Lynne
06-07-2009, 05:32 PM
I'm suggesting a larger width just to see if it will work. It looks to me like the table width is being affected by the side of the max characters. So, if you make the width way larger than that, you can see if the width is working or not.

squishi
06-08-2009, 12:23 PM
I set it to 300 now. The tables do not expand. :(

Lynne
06-08-2009, 02:57 PM
In your header (thead) where it lists Info & Intro, Last Post, etc, you are setting the width for the column Info & Intro to 100% and that is interferring with your Last Post width. Get rid of the 100%:
<td class="thead" width="100%" align="left">
<a href="forumdisplay.php?f=42">Info &amp; Intro</a>
</td>

squishi
06-08-2009, 06:12 PM
I removed the width of 100% and the table cells expanded.
But now I have an unwanted effect in the whole table cell. It seems the attribute width="100%" in the table tag is not followed.

squishi
06-08-2009, 06:27 PM
Okay, cool. I checked the markup on vbulletin.org.
With using relative widths in the thead cells, I was able to fix the problem.