Solved

Colgroup in Chrome

Posted on 2012-03-17
3
637 Views
Last Modified: 2012-08-13
I am trying to line up a table, and it displays as expected in Firefox but not in Chrome.  All three columns are bumped up against each other.

HTML:
<div id='JKL'>
	<table class="warning">
		<tr>
			<colgroup>
			<col class="col1" />
			<col class="col2" />
			<col class="col3" />
			</colgroup>
			<td><img src="../images/arrowdown.gif"></td>
			<td>Don't stop here!<br><span class="secondline">Now</span></td>
			<td><img src="../images/arrowdown.gif"></td>
		</tr>
	</table>
</div>

Open in new window


CSS:
#JKL .warning table
{
    background: #ffffff;
    overflow: hidden;
    margin-bottom: 20px;
    margin-top: 20px;
	margin-left:auto;
	margin-right:auto;
	height: 30px;
}
#JKL .warning td
{
    font-size: 16px;
	font-weight:bold;
	padding-top: 10px;
	margin-left:auto;
	margin-right:auto;
	text-align: center;
	vertical-align: center;
}
#JKL .warning .col1 .col3
{
    width: 60px;
}
#JKL .warning .col2
{
    width: 90%;
}

#JKL .warning td .secondline
{
    font-size: 12px;
	padding: 5px;
	margin-left: 2px;
	vertical-align:top;
	height: 30px;
}

Open in new window

0
Comment
Question by:kkbenj
  • 2
3 Comments
 
LVL 16

Expert Comment

by:s8web
ID: 37732503
Your CSS selectors should be:

#JKL table.warning
0
 
LVL 16

Accepted Solution

by:
s8web earned 500 total points
ID: 37732510
#JKL  table.warning
{
    background: #ffffff;
    overflow: hidden;
    margin-bottom: 20px;
    margin-top: 20px;
	margin-left:auto;
	margin-right:auto;
	height: 30px;
}
#JKL table.warning td
{
    font-size: 16px;
	font-weight:bold;
	padding-top: 10px;
	margin-left:auto;
	margin-right:auto;
	text-align: center;
	vertical-align: center;
}
#JKL table.warning .col1, #JKL table.warning .col3
{
    width: 60px;
}
#JKL table.warning .col2
{
    width: 90%;
}

#JKL table.warning td span.secondline
{
    font-size: 12px;
	padding: 5px;
	margin-left: 2px;
	vertical-align:top;
	height: 30px;
}

Open in new window

0
 

Author Closing Comment

by:kkbenj
ID: 37732605
Perfect.  Thank you.
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
SharePoint 2013 Searchbox Branding 11 45
Responsive CSS question 2 62
jQuery CSS Scroll Issue 3 74
CSS Font Arial Narrow 1 26
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

895 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

19 Experts available now in Live!

Get 1:1 Help Now