Sign in to follow this  
Followers 0
marklcfc

HTML table column problem

8 posts in this topic

This is the issue (the top bar isn't in line with what follows - its not far off but its not right)

post-103369-0-11685900-1348309880.png

Despite setting the % to the same as what follows, the problem is this scroller bar its affecting the width so whilst setting the % of the grey bar the same, it isn't working.

Grey bar:


<table><tr class=last><td width=5%></td><td width=15%>Date</td><td width=10%>Result</td><td width=25%>Against</td><td

width=25%>Competition</td><td width=6%>Start</td><td width=6%>Sub</td><td width=6%>Goals</td><td

width=17px></td></tr></table>[/CODE]

I even added that 17px td to the end to see if that would solve it, and it didn't. I used 17px as that is the width of the scroller.

Please can someone advise :)

Share this post


Link to post
Share on other sites

If you use units like px in HTML it won't work (only use plain numbers or percentages), just change the value to 17. Only use units like px in CSS.

Also some browsers don't show anything if there's no content within some HTML, just try and add an   in there or something.

Share this post


Link to post
Share on other sites

Changed to


<table><tr class=last><td width=5%> </td><td width=15%>Date</td><td width=10%>Result</td><td
width=25%>Against</td><td width=25%>Competition</td><td width=6%>Start</td><td width=6%>Sub</td><td
width=6%>Goals</td><td width=17> </td></tr></table>
[/CODE]

but the result is the same.

Share this post


Link to post
Share on other sites

Why are you even building a grid via html in the first place? Use a datagrid instead and bind it to whatever your data source is.

Share this post


Link to post
Share on other sites

From what little information you have given you have two tables there?

Table 1 - Grey bar

Table 2 - Results

Why not combine them into one table? Im guessing its a table reading from a database?


&lt;table&gt;
&lt;tr class=last&gt;
&lt;td width=5%&gt; &lt;/td&gt;&lt;td width=15%&gt;Date&lt;/td&gt;&lt;td width=10%&gt;Result&lt;/td&gt;&lt;td
width=25%&gt;Against&lt;/td&gt;&lt;td width=25%&gt;Competition&lt;/td&gt;&lt;td width=6%&gt;Start&lt;/td&gt;&lt;td width=6%&gt;Sub&lt;/td&gt;&lt;td
width=6%&gt;Goals&lt;/td&gt;&lt;td width=17&gt; &lt;/td&gt;
&lt;/tr&gt;
//end of grey bar and start of php loop
&lt;tr&gt;
&lt;td&gt;&lt;?=postition?&gt;&lt;/td&gt;&lt;td&gt;&lt;?=date?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

I am just a novice, im sure someone will clean up what i wrote or you can work out what i mean i only dabble and learn when im bored and that was a year ago.

Share this post


Link to post
Share on other sites

Yes I have two tables, mainly so I could keep the grey bar visible at the top whilst still being able to scroll down though the next table.

Share this post


Link to post
Share on other sites

Google "scrollable table fixed heading" and you will find some tutorials, it will also fix your issue.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.