123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <title>Alt-Web Demos :: CSS Clickable Table Cells</title>
<link href="http://alt-web.com/alt-style/CSS2.css" rel="stylesheet" type="text/css" />

<body class="demos tables">
<div id="wrapper">
<div id="topWrapper">
&nbsp;&nbsp;
</div>

<div id="content">
<h1 class="center">Alt-Web Design &amp; Publishing<br />
CSS Clickable Table Cells</h1>

<h3>Description:</h3>
Sometimes it's nice to have an entire table cell  behave
like an active link or button. Unfortunately HTML doesn't allow  &lt;td&gt; tags
to be inside anchors. When used, anchors need to be inside &lt;td&gt; tags. 
Now with the magic of CSS, we can style table cells and the anchor
tags inside them to work as a single  unit. 
<h3> Example:</h3>
<table class="prod" cellspacing="0" cellpadding="0">
<tr>
<th colspan="3">Mouseover or use your Tab key to highlight
cells below </th>
</tr>
<tr>
<td>
<p><a href="http://alt-web.com/DEMOS/CSS-Clickable-Table-Cells.shtml#"><img src="http://alt-web.com/Images/Music-64.png" alt="music" width="64" height="64" />Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></p>
</td>
<td>
<p><a href="http://alt-web.com/DEMOS/CSS-Clickable-Table-Cells.shtml#"><img src="http://alt-web.com/Images/maple-leaf.png" alt="Maple Leaf" width="64" height="64" />Lorem
ipsum dolor sit amet, consectetur adipiscing elit.</a></p>
</td>
<td>
<p><a href="http://alt-web.com/DEMOS/CSS-Clickable-Table-Cells.shtml#"><img src="http://alt-web.com/Images/icon_128.png" alt="Safari" width="64" height="64" />Lorem
ipsum dolor sit amet, consectetur adipiscing elit.</a></p>
</td>
</tr>
<tr>
<td>
<p><a href="http://alt-web.com/DEMOS/CSS-Clickable-Table-Cells.shtml#">Some link </a></p>
</td>
<td>
<p><a href="http://alt-web.com/DEMOS/CSS-Clickable-Table-Cells.shtml#">Some link </a></p>
</td>
<td>
<p><a href="http://alt-web.com/DEMOS/CSS-Clickable-Table-Cells.shtml#">Some link </a></p>
</td>
</tr>
</table>

<h3>Method:</h3>
<p>I built this table with a product catalog in mind so my CSS selector name
(.prod) reflects this. You can change the code to use any selector name you wish.</p>
<div class="floatright">
<!--begin ad -->
<p><a href="http://www.tkqlhce.com/kj122ar-xrzEIGFMOONEGFKJJHJJ" target="_top">
<img src="http://www.ftjcfx.com/49116tkocig15329BBA132766466" alt="How I survived a computer disaster" border="0" /></a></p>
<p>&nbsp;</p>
<!-- end ad -->
<!--begin ad -->
<p><a href="http://www.tkqlhce.com/7o70gv30v2IMKJQSSRIKJOSJPKQ" target="_top">
<img src="http://www.awltovhc.com/en98xjnbhf04218AA90216A1728" alt="Spam Filter - Free Trial" border="0" /></a></p>
<!--end Ad -->



</div> <!--end floatright -->



<div class="Code">
<h2>CSS2 Code</h2>
<p>table.prod {<br />
width: 600px; <br />
border-collapse:collapse; border:none;<br />
}</p>
<p>.prod a img {<br />
border:none; <br />
float:left; <br />
padding-right:12px;<br />
}</p>
<p> .prod td {<br />
width:200px;<br />
border: 1px solid #000<br />
}</p>
<p>.prod td p {<br />
margin:0;<br />
line-height: 1.2em;<br />
font-size: 16px;<br />
}</p>
<p class="Comments">/**here's the magic part**/</p>
<p>.prod td a {<br />
display:block;<br />
height:7em; <span class="Comments">/**adjust height in ems as required**/</span> <br />
text-decoration:none;
<br />
}</p>
<p class="Comments">/**link states**/ </p>
<p>.prod td a:link {color: #000}</p>
<p>.prod td a:visited {color:#666}</p>
<p>.prod td a:hover, .prod td a:active, 
.prod td a:focus {<br />
background-color:#CCFF00<br />
}</p>
</div> 
<!--end CSS Code Box -->


<br class="clearing" />
<p class="center">
<!--Begin Ads -->
<a href="http://www.lunarpages.com/id/NancyO" onmouseover="window.status='http://www.lunarpages.com';return true" onmouseout="window.status='';return true" target="_blank"><img style="border: none" src="http://www.lunarpages.com/affiliatebanners/468x60.gif" alt="Lunarpages.com Web Hosting" /></a>
<!--end Ads --></p>




<div class="Code">
<h2>HTML Code</h2>

<p>&lt;table class=&quot;prod&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;</p>
<p>&lt;tr&gt;<br />
&lt;td&gt;&lt;p&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;your-image.png&quot;/&gt;Some
link text goes here&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;<br />
<br />
&lt;td&gt;&lt;p&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;your-image.png&quot;/&gt;Some
link text goes here&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;<br />
<br />
&lt;td&gt;&lt;p&gt;&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;your-image.png&quot;/&gt;Some
link text goes here&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;tr&gt;<br />
&lt;td&gt;&lt;p&gt;&lt;a href=&quot;#&quot;&gt;Some link&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;
<br />
&lt;td&gt;&lt;p&gt;&lt;a href=&quot;#&quot;&gt;Some link&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;
<br />
&lt;td&gt;&lt;p&gt;&lt;a href=&quot;#&quot;&gt;Some link&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;/table&gt;<br />
</p>
</div>
<!--end HTML Code Box -->
<p>&nbsp;</p>

<div style="position:fixed; z-index: 100; top:0; left:0; width:100%; min-width:1100px">

<!--top menu -->
  </div><!--end bottom wrapper-->
</div><!--end wrapper -->
            
          
!
            
              table.prod {width: 600px; margin:.50em  auto;border-collapse:collapse; border:none;}

.prod a img {border:none; float:left; padding-right:12px;}

.prod th {
	height: 2em;
	font-size: 18px;
	font-weight:400;
	vertical-align:middle;
	text-align: center;
	border: 1px solid #000;
}
.prod td {width:200px;border: 1px solid #000}

.prod td p {
margin:0;
line-height: 1.2em;
font-size: 16px;
}

/**TABLE LINK STATES**/
.prod td a {
display:block;
height:7em;
text-decoration:none;
font-weight: normal;
}
.prod td a:link {color: #000}
.prod td a:visited {color:#666}
.prod td a:hover, 
.prod td a:active, 
.prod td a:focus {background-color:#CCFF00}
            
          
!
            
              /* 

<title>Alt-Web Demos :: CSS Clickable Table Cells</title>


<p>SOURCE: <a href="http://alt-web.com/DEMOS/CSS-Clickable-Table-Cells.shtml" target="_blank"><i><b>CSS Clickable Table Cells</b></i></a></p>



by alt-web.com

 */
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console