Cant control Data widths within TD elements

I have data that I am displaying within a table.
The table has 5 columns with a header.
Each element has a CSS class assigned to it.

The objective is to keep the column widths fixed over any requeries using a filter on the same page.

The observed behaviour is that the column widths do not respect the min/max width of the CSS properties and shrink to the size of the largest data item.

I have tried wrapping the data with DIVs within the TDs but that is no help. See code attached
Charles SugdenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
No code attached... but it might not help.  You may need to use 'overflow' in CSS.
0
Charles SugdenAuthor Commented:
Code file is now attached...Sorry Dave!
htmlTableProblem.txt
0
Dave BaldwinFixer of ProblemsCommented:
Ok, you need to show me the code seen in the "View Source" of your browser.  It is not possible to tell what your server side code is going to generate.  But it Always ends up as HTML in a browser and that's where we have to identify the problem.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Charles SugdenAuthor Commented:
I have enclosed the html source from the first page and the source from the second page after a filter expression was applied.

The html was optimized a bit since the initial code but the problem remains
htmlFirstPass.htm
htmlSecondPass.htm
0
Dave BaldwinFixer of ProblemsCommented:
I thought that would help but not nearly enough.  You have too many scripts to load (that I don't have) to be able to display that on my computer.  And I would guess that it is supposed to be 'responsive' also which complicates the problem.  If this is available online, then maybe a link would let us see what's going on.
0
Charles SugdenAuthor Commented:
I am enclosing a screen shot of what I see. I see no visible reason in the HTML for this to occur. I figure it is a peculiarity of oneof the tags.

This app is generetaed using a MVC4 demo. The master page is almost verbatim with what you would find on line. I have also included that here
FirstPass.GIF
SecondPass.GIF
Layout.txt
0
Dave BaldwinFixer of ProblemsCommented:
I don't see an actual problem there.  The most likely difference is that in the FirstPass image, there are probably longer strings in cells that are not visible in that view.  Scroll down and you will probably find them.  In SecondPass, there would be no strings longer than what are seen on the screen.  What you are seeing is normal behavior for <td>s in tables that have no specific width.

If you do something like this, all the columns will stay put... as long as none of the data is wider than the column.  You can see that I put a specific width in each of the <th> columns.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Untitled</title>
</head>
<body>
<table class="indextable" id="example" border="1">

    <tr>
        <th width="180px">
            Name
        </th>
        <th width="200px">
            Company Name
        </th>
        <th width="240px">
            E-Mail
        </th>
        <th width="180px">
            Phone
        </th>
        <th width="180px">
            Actions
        </th>
    </tr>

        <tr>
        <td class="custindextd">
            Ms. Catherine R. Abel 
        </td>
        <td class="custindextd">
            Professional Sales and Service
        </td>
        <td class="custindextd">
            catherine0@adventure-works.com
        </td>
        <td class="custindextd">
            747-555-0171
        </td>
        <td class="custindextd"> 
        

            <a href="/Customer/Edit/29485">
            <img alt = "Edit" src="/Images/edit.gif"  class="Icon" title="Edit"/>
            </a> 
            <a href="/Customer/Details/29485">
            <img alt = "Detail" src="/Images/details.gif" class="Icon" title="Info"/>
            </a>            
            <a href="/Customer/Delete/29485">
            <img alt = "Delete" src="/Images/del.gif"  class="Icon" title="Delete"/>
            </a> 
            <a href="/Customer/Sales/29485">
            <img alt = "Sales" src="/Images/information.gif"  class="Icon" title="Sales"/>
            </a> 
         </td>
    </tr>
        <tr>
        <td class="custindextd">
            Mr. Christopher R. Beck Jr.
        </td>
        <td class="custindextd">
            Bulk Discount Store
        </td>
        <td class="custindextd">
            christopher1@adventure-works.com
        </td>
        <td class="custindextd">
            1 (11) 500 555-0132
        </td>
        <td class="custindextd"> 
        

            <a href="/Customer/Edit/29546">
            <img alt = "Edit" src="/Images/edit.gif"  class="Icon" title="Edit"/>
            </a> 
            <a href="/Customer/Details/29546">
            <img alt = "Detail" src="/Images/details.gif" class="Icon" title="Info"/>
            </a>            
            <a href="/Customer/Delete/29546">
            <img alt = "Delete" src="/Images/del.gif"  class="Icon" title="Delete"/>
            </a> 
            <a href="/Customer/Sales/29546">
            <img alt = "Sales" src="/Images/information.gif"  class="Icon" title="Sales"/>
            </a> 
         </td>
    </tr>
        <tr>
        <td class="custindextd">
            Mr. Donald L. Blanton 
        </td>
        <td class="custindextd">
            Coalition Bike Company
        </td>
        <td class="custindextd">
            donald0@adventure-works.com
        </td>
        <td class="custindextd">
            357-555-0161
        </td>
        <td class="custindextd"> 
        

            <a href="/Customer/Edit/29568">
            <img alt = "Edit" src="/Images/edit.gif"  class="Icon" title="Edit"/>
            </a> 
            <a href="/Customer/Details/29568">
            <img alt = "Detail" src="/Images/details.gif" class="Icon" title="Info"/>
            </a>            
            <a href="/Customer/Delete/29568">
            <img alt = "Delete" src="/Images/del.gif"  class="Icon" title="Delete"/>
            </a> 
            <a href="/Customer/Sales/29568">
            <img alt = "Sales" src="/Images/information.gif"  class="Icon" title="Sales"/>
            </a> 
         </td>
    </tr>
        <tr>
        <td class="custindextd">
            Mr. Cory K. Booth 
        </td>
        <td class="custindextd">
            Remarkable Bike Store
        </td>
        <td class="custindextd">
            cory0@adventure-works.com
        </td>
        <td class="custindextd">
            121-555-0157
        </td>
        <td class="custindextd"> 
        

            <a href="/Customer/Edit/29531">
            <img alt = "Edit" src="/Images/edit.gif"  class="Icon" title="Edit"/>
            </a> 
            <a href="/Customer/Details/29531">
            <img alt = "Detail" src="/Images/details.gif" class="Icon" title="Info"/>
            </a>            
            <a href="/Customer/Delete/29531">
            <img alt = "Delete" src="/Images/del.gif"  class="Icon" title="Delete"/>
            </a> 
            <a href="/Customer/Sales/29531">
            <img alt = "Sales" src="/Images/information.gif"  class="Icon" title="Sales"/>
            </a> 
         </td>
    </tr>
		</table>
</body>
</html>

Open in new window

0
Charles SugdenAuthor Commented:
perhaps I havent explained this properly. I would like the style info to truncate the output of the longer-than-width of the column.

I tried your example also by drastically shortening the width and it only wrapped. I also tried style="width:20px;overflow:hidden;    min-width:20px;    max-width:20px; white-space:nowrap;" which i though should have worked but that also wrapped.

Is there any solution using html or do I have to adjust the data source?
0
Dave BaldwinFixer of ProblemsCommented:
I would have thought that would work too but it clearly doesn't.  I don't know at the moment.
0
Charles SugdenAuthor Commented:
I am going to cancel this question and perhaps with time come closer to the answer.
Thank you for your help
0
Charles SugdenAuthor Commented:
After spending numerous hours of my own time on this problem while waiting for others to comment I have made the following progress and come to the following conclusion:

1. It has been sometime since I fixed this bug and I thought I closed out this POST
1. Wordy and/or complex CSS files can be disasterous to your health
2. I have overcome my own bug by finding a spurious character in my CSS sevral lines prior to the CSS controlling the widths and before a CSS comment line.
3. The spurious character caused the controlling-width CSS not to be recognized
4. My thanks to Dave Baldwin for at least giving some thought and his own time to this problem
5. I suppose he should be awarded some points for his effort although at the time I though that might have been considered poor taste to give him less than his due and close out the POST.

Thanks for calling out the attention to this matter
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Charles SugdenAuthor Commented:
This was clearly a bug in my own code and perhaps the attachments were redacted not to show the spurious character
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.