Solved

My 1st column in my HTML table is too wide

Posted on 2016-09-20
5
81 Views
Last Modified: 2016-09-22
Here's my code for the first six rows.
<style type="text/css">
table, th, td {
    border: 1px solid black;
	}
</style>
<TABLE width="100%" border="1" valign="TOP">
               <TR bgColor="#cccccc">
                    <TH>
                         <font color="black">
                              <u><DIV align="left">Overnight Batch Processing</DIV></u>
                         </font>
                    </TH>
                   <TH>
                         <font color="black">
                              <u>SLA/OLA</u>
                         </font>
                    </TH>
                    <TH>
                         <font color="black">
                              <u>END TIME</u>
                         </font>
                    </TH>
					<TH>
                         <font color="black">
                              <u>BUSINESS IMPACT</u>
                         </font>
                    </TH>
					<TH>
                         <font color="black">
                              <u>IM</u>
                         </font>
                    </TH>
					<TH>
                         <font color="black">
                              <u>REASON</u>
                         </font>
                    </TH>
					</TR>
					<TR bgColor="#33e9ff" border="0">
                        <td colspan="6">					    
						<font color="3336ff">
						      <u><DIV align="left"><p style="font-size:20px">Mutual Funds</p></DIV></u>
					     </font>
					    </td>
					</TR>
				    <TR border="1">
					   <TD>
					   <font color="black">
					           <DIV align="left">Mutual Funds EOD Release</DIV>
					    </font>
						</TD>
					   <TD>
					 <font color="black">
					      <DIV align="center"><b>6:50pm</b></DIV>
					 </font>
					</TD>
					 <TD>
					 <DIV align="center"><b><xsl:apply-templates select="MF38035A"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="MF38035A_BI"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="MF38035A_IM"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="MF38035A_RS"/></b></DIV>
					</TD>
					</TR>
					<TR bgColor="#33e9ff" border="0">
                        <td colspan="6">					    
						<font color="3336ff">
						      <u><DIV align="left"><p style="font-size:20px">Insurance/ISA</p></DIV></u>
					     </font>
					    </td>
					</TR>
					 <TR border="1">
					   <TD>
					   <font color="black">
					           <DIV align="left">Insurance Database</DIV>
					    </font>
						</TD>
					   <TD>
					 <font color="black">
					      <DIV align="center"><b>10:30pm</b></DIV>
					 </font>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="BT30004"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="Bt30004_BI"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="BT30004_IM"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="BT30004_RS"/></b></DIV>
					</TD>
					</TR>
					<TR border="1">
					   <TD>
					   <font color="black">
					           <DIV align="left">ISA Database</DIV>
					    </font>
						</TD>
					   <TD>
					 <font color="black">
					      <DIV align="center"><b>12:00am</b></DIV>
					 </font>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="LASTISA"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="LASTISA_BI"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="LASTISA_IM"/></b></DIV>
					</TD>
					<TD>
					 <DIV align="center"><b><xsl:apply-templates select="LASTISA_RS"/></b></DIV>
					</TD>
					</TR>
</TABLE>

Open in new window


I attached file screen print showing the 1st 6 rows of a long report.

As you can see the 1st column is too wide.
Screen-print-of-the-web-page.PNG
0
Comment
Question by:rkckjk
5 Comments
 
LVL 29

Assisted Solution

by:Randy Downs
Randy Downs earned 125 total points
ID: 41806520
The table is adjusting to the entire screen. Maybe try making it a smaller percentage like 60%.

TABLE width="60%"

Open in new window

0
 
LVL 35

Accepted Solution

by:
Kimputer earned 250 total points
ID: 41806529
Experiment with this code:

<TH width="20%">
                         <font color="black">
                              <u><DIV align="left">Overnight Batch Processing</DIV></u>
                         </font>
                    </TH>

Open in new window


It's the percentage that you want to adjust. If you want to fix it, can also be points, as in 200px
0
 
LVL 33

Assisted Solution

by:ste5an
ste5an earned 125 total points
ID: 41806555
First of all: Make yourself familiar with HTML, HTML5 and CSS. This will reduce your code drastically. E.g.

<!DOCTYPE html>
<html>
    <head>
        <style type="text/css">
            table { width: 100%; }
            table, td { border: 1px solid black; text-align: center; }
            td:first-child { text-align: left; width: 320px; }
            thead { background-color: #cccccc; }
            thead td { text-decoration: underline; }
            tbody tr.crossheading td { background-color: #33e9ff; color: #3336ff; font-size: 20px; text-decoration: underline; }
            tbody td { font-weight: bold; }            
        </style>
    </head>
    <body>
        <table>
            <thead>
                <tr>
                    <td>Overnight Batch Processing</td>
                    <td>SLA/OLA</td>
                    <td>END TIME</td>
                    <td>BUSINESS IMPACT</td>
                    <td>IM</td>
                    <td>REASON</td>
                </tr>
            </thead>
            <tbody>
                <tr class="crossheading">
                    <td colspan="6">Mutual Funds</td>
                </tr>
                <tr>
                    <td>Mutual Funds EOD Release</td>
                    <td>6:50pm</td>
                    <td><xsl:apply-templates select="MF38035A"/></td>
                    <td><xsl:apply-templates select="MF38035A_BI"/></td>
                    <td><xsl:apply-templates select="MF38035A_IM"/></td>
                    <td><xsl:apply-templates select="MF38035A_RS"/></td>
                </tr>
            </tbody>
        </table>
    </body>
</html>

Open in new window

0
 
LVL 2

Author Closing Comment

by:rkckjk
ID: 41807090
I like all the solutions, but I picked the easiest one to use at this time.
0
 
LVL 33

Expert Comment

by:ste5an
ID: 41810271
btw:

- FONT is a deprecated element and should not be used.
- Your usage of DIV in TD is wrong, cause DIV is a block element, but you assign only text. The correct element in this case is SPAN.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Button Css BootStrap 2 36
Bad <form> statement? 9 26
push logos in footer up higher 5 12
execute script based on HTML event 7 0
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now