473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 16332
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. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.