Solved

Colgroup in Chrome

Posted on 2012-03-17
3
646 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to position loader with CSS 3 55
tiny glitch in my main slider 3 40
Flex container exceeding stated width in IE11 4 15
100% tall div not scrollable on iPhone 3 21
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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 tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

830 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