Jump to content



Photo

HTML table column problem


  • Please log in to reply
7 replies to this topic

#1 marklcfc

marklcfc

    Neowinian

  • Joined: 30-March 05

Posted 22 September 2012 - 10:34

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

Untitled-1.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>

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 :)


#2 +jamesyfx

jamesyfx

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 04-February 06
  • Location: Manchester, UK
  • OS: OS X 10.9 / Windows 8.1
  • Phone: Nexus 5

Posted 22 September 2012 - 10:37

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 &nbsp; in there or something.

#3 OP marklcfc

marklcfc

    Neowinian

  • Joined: 30-March 05

Posted 22 September 2012 - 10:50

Changed to

<table><tr class=last><td width=5%>&nbsp;</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>&nbsp;</td></tr></table>

but the result is the same.

#4 Rohdekill

Rohdekill

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 06-July 05
  • Location: Earth

Posted 22 September 2012 - 11:04

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.

#5 OP marklcfc

marklcfc

    Neowinian

  • Joined: 30-March 05

Posted 22 September 2012 - 12:40

Html and basic php is all I know.

#6 Xoligy

Xoligy

    Neowinian

  • Joined: 09-May 10

Posted 22 September 2012 - 14:01

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?


<table>
<tr class=last>
<td width=5%>&nbsp;</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>&nbsp;</td>
</tr>
//end of grey bar and start of php loop
<tr>
<td><?=postition?></td><td><?=date?></td>
</tr>
</table>

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.

#7 OP marklcfc

marklcfc

    Neowinian

  • Joined: 30-March 05

Posted 22 September 2012 - 15:12

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.

#8 Xoligy

Xoligy

    Neowinian

  • Joined: 09-May 10

Posted 22 September 2012 - 16:34

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