472,982 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 software developers and data experts.

TD unable to align Center

Hi,

I am creating a table to list some data. The table is using a sorting and highlight function that I found from the net.

I can't attach image here, basically html will wrap the heading, therefore I notice the second line of the header is left align instead of centering. I believe it's because of the sort.htc script that will output an arrow when user click on the header to sort.

The code is as below:

Expand|Select|Wrap|Line Numbers
  1. <TABLE  width="100%">
  2. <TR>
  3. <TD ALIGN="top" class="line" style="font-family: Verdana, Helvetica; color: black; font-weight: bold; font-size: 12px;">
  4. <A HREF="#" class="nounderlinelink" onClick="clickImg('previous');"><IMG SRC="/wms-img2/arr_prev.gif" ALIGN="bottom" ALT="Previous" width="16" height="13" border="0"></A>
  5. Page 
  6. <INPUT TYPE="text" NAME="in_go_page" class="textfield" SIZE="4" MAXLENGTH="4" VALUE="1">
  7. <INPUT TYPE="button" VALUE="Go" class="buttonstyle" onClick="goPage();">
  8. of  327
  9. <A HREF="#" class="nounderlinelink" onClick="clickImg('next');"><IMG SRC="/wms-img2/arr_next.gif" ALIGN="bottom" ALT="Next" width="16" height="13" border="0"></A>
  10. </TD>
  11. </TR>
  12. </TABLE>
  13.  
  14.         <table border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#666666">
  15.            <tr> 
  16.                <td colspan="2" align="left" valign="top" bgcolor="#9BCDE6"><img src="/wms-img2/tleft_top.gif" width="10" height="10"></td>
  17.                <td colspan="2" align="right" valign="top" bgcolor="#9BCDE6"><img src="/wms-img2/tright_top.gif" width="10" height="10"></td>
  18.            </tr>
  19.            <tr> 
  20.              <td width="11" bgcolor="#9BCDE6" class="sidetablewidth">&nbsp;</td>
  21.              <td colspan="2">
  22.              <table width="100%" border="0" cellspacing="1" cellpadding="3"  style="behavior:url(/wms-img2/css/tablehl.htc) url(/wms-img2/css/sort.htc);" slcolor=#6C9CFF hlcolor=#FFFFCC> 
  23. <THEAD>
  24.             <tr class="headerColor">
  25. <TD ALIGN="Center"  CLASS="headerColor" >Pallet Number</TD>
  26. <TD ALIGN="Center"  CLASS="headerColor" >Location</TD>
  27. <TD ALIGN="Center"  CLASS="headerColor" >Owner Code</TD>
  28. <TD ALIGN="Center"  CLASS="headerColor" >Product</TD>
  29. <TD ALIGN="Center"  CLASS="headerColor" >Lot Number</TD>
  30. <TD ALIGN="Center"  CLASS="headerColor" >Serial Number</TD>
  31. <TD ALIGN="Center"  CLASS="headerColor" >Expiry Date</TD>
  32. <TD ALIGN="Center"  CLASS="headerColor" >ASN Number</TD>
  33. <TD ALIGN="Center"  CLASS="headerColor" >Document Number( Receipt Number)</TD>
  34. </tr></THEAD>
  35.  
Any idea how I can align all the line into Center?

Thanks in advance.
Mar 10 '08 #1
2 16304
AricC
1,892 Expert 1GB
Hi,

I am creating a table to list some data. The table is using a sorting and highlight function that I found from the net.

I can't attach image here, basically html will wrap the heading, therefore I notice the second line of the header is left align instead of centering. I believe it's because of the sort.htc script that will output an arrow when user click on the header to sort.

The code is as below:

Expand|Select|Wrap|Line Numbers
  1. <TABLE  width="100%">
  2. <TR>
  3. <TD ALIGN="top" class="line" style="font-family: Verdana, Helvetica; color: black; font-weight: bold; font-size: 12px;">
  4. <A HREF="#" class="nounderlinelink" onClick="clickImg('previous');"><IMG SRC="/wms-img2/arr_prev.gif" ALIGN="bottom" ALT="Previous" width="16" height="13" border="0"></A>
  5. Page 
  6. <INPUT TYPE="text" NAME="in_go_page" class="textfield" SIZE="4" MAXLENGTH="4" VALUE="1">
  7. <INPUT TYPE="button" VALUE="Go" class="buttonstyle" onClick="goPage();">
  8. of  327
  9. <A HREF="#" class="nounderlinelink" onClick="clickImg('next');"><IMG SRC="/wms-img2/arr_next.gif" ALIGN="bottom" ALT="Next" width="16" height="13" border="0"></A>
  10. </TD>
  11. </TR>
  12. </TABLE>
  13.  
  14.         <table border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#666666">
  15.            <tr> 
  16.                <td colspan="2" align="left" valign="top" bgcolor="#9BCDE6"><img src="/wms-img2/tleft_top.gif" width="10" height="10"></td>
  17.                <td colspan="2" align="right" valign="top" bgcolor="#9BCDE6"><img src="/wms-img2/tright_top.gif" width="10" height="10"></td>
  18.            </tr>
  19.            <tr> 
  20.              <td width="11" bgcolor="#9BCDE6" class="sidetablewidth">&nbsp;</td>
  21.              <td colspan="2">
  22.              <table width="100%" border="0" cellspacing="1" cellpadding="3"  style="behavior:url(/wms-img2/css/tablehl.htc) url(/wms-img2/css/sort.htc);" slcolor=#6C9CFF hlcolor=#FFFFCC> 
  23. <THEAD>
  24.             <tr class="headerColor">
  25. <TD ALIGN="Center"  CLASS="headerColor" >Pallet Number</TD>
  26. <TD ALIGN="Center"  CLASS="headerColor" >Location</TD>
  27. <TD ALIGN="Center"  CLASS="headerColor" >Owner Code</TD>
  28. <TD ALIGN="Center"  CLASS="headerColor" >Product</TD>
  29. <TD ALIGN="Center"  CLASS="headerColor" >Lot Number</TD>
  30. <TD ALIGN="Center"  CLASS="headerColor" >Serial Number</TD>
  31. <TD ALIGN="Center"  CLASS="headerColor" >Expiry Date</TD>
  32. <TD ALIGN="Center"  CLASS="headerColor" >ASN Number</TD>
  33. <TD ALIGN="Center"  CLASS="headerColor" >Document Number( Receipt Number)</TD>
  34. </tr></THEAD>
  35.  
Any idea how I can align all the line into Center?

Thanks in advance.
In the style tag why don't you add text-align: center if you want to center some text. Also your table looks somewhat like malformed HTML
Mar 11 '08 #2
In the style tag why don't you add text-align: center if you want to center some text. Also your table looks somewhat like malformed HTML
Hi,

I did according to your suggestion

Expand|Select|Wrap|Line Numbers
  1. <table width="100%" border="0" cellspacing="1" cellpadding="3"  style="behavior:url(/wms-img2/css/tablehl.htc) url(/wms-img2/css/sort.htc) text-align:center" slcolor=#6C9CFF hlcolor=#FFFFCC> 
  2.  
The result is the same. Because I didn't specify NOWRAP, so the label like "Quantity On Hand" will become 3 lines, with second and third line align more to left instead of center.

By the way, what do you mean by malformed HTML?
Mar 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Charles Crume | last post by:
Hello; I'm fairly new to CSS, but have learned that Mozilla is supposed to be the most compliant in rendering. I have a web page that uses a style sheet with a class named "page_links" that...
3
by: VB Programmer | last post by:
I cant 'align center' a text box. First of all, all the justifications (left, center, right) on the toolbar are dimmed. Why? Also, when I try to do it through HTML (wrapping the control in a...
3
by: tshad | last post by:
I have the following: <tr valign="baseline"> <td align="center" width="103" colspan=2 nowrap> <asp:Button ID="ViewPositions" runat="server" Text="View Positions" OnClick="ViewPositions_Click"...
2
by: Eric Lindsay | last post by:
If I want to have the middle of an image vertically aligned with the middle of a heading (or several lines of heading), is there some particular way people would recommend? vertical-align: center...
3
by: jaiwin | last post by:
I am insert a div tag in table. table width is 100%. div width is 500px. i want to center alignment in div tag. so which command i want to use this <table align="center" border="0"...
1
by: Steve Richter | last post by:
I am using <div align=centerto center a horizontal menu on the page. Problem is the center align of the div is rippling down to the menu items and causing the text of the dynamic popup sub menu...
3
by: divina11 | last post by:
Oddly, I can't seem to get the image to align to the center of the page? I'm using IE 6, tried FireFox 2 still the same! The image just aligns to the right for same reason. The text aligns to the...
7
by: dangermouse | last post by:
ok First time here and this is no doubt something really obvious I am overlooking. I use the following css and html to try and center a container div on a page. For the life of me it will not center...
13
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. ...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.