How to exclude table from certain styles - html

I have a <table> that I am trying to make mobile-friendly with some CSS. However, I do not want this 'mobile-friendly' CSS to apply to all our tables. The CSS should not be applied to tables that have the class no-wrap. All of the tables we use have the class .table2. We also have a lot of nested tables. And these nested tables are the main problem. Here is an example with jsfiddle.
As you can see in the example, the first table has 2 classes; table2 and no-wrap. I do not want to apply the 'mobile-friendly' CSS to tables that have the no-wrap class. So the first example works fine because the CSS is not applied. However, the second table also has the no-wrap class, but I guess because it is nested inside another table (that also has the class table2), it does not look at the :not(.no-wrap) selector and the CSS is applied.
Code for reference:
.table2 {
color: #000000;
width: 100%;
table-layout: fixed;
overflow: hidden;
border-spacing: 10px 5px;
border: 1px solid gray;
}
#media only screen and (max-width: 1024px) {
.track table.table2:not(.no-wrap),
.track .table2:not(.no-wrap) thead,
.track .table2:not(.no-wrap) tbody,
.track .table2:not(.no-wrap) th,
.track .table2:not(.no-wrap) td,
.track .table2:not(.no-wrap) tr {
display: block;
}
.track .table2:not(.no-wrap) tr {
margin: 20px;
}
.track .table2:not(.no-wrap) tr[height] {
height: 0;
}
.track .table2:not(.no-wrap) td {
position: relative;
margin: 5px 0;
}
}
<div class="track">
<table cellspacing="0" cellpadding="0" class="table2 no-wrap">
<tbody>
<tr height="19">
<td width="170"></td>
<td></td>
<td width="80"></td>
<td width="80"></td>
<td width="80"></td>
<td width="80"></td>
<td width="100"></td>
</tr>
<tr>
<td class="trackFormHeaderTitle">Artikel</td>
<td class="trackFormHeaderTitle">Omschrijving</td>
<td class="trackFormHeaderTitle" align="right">Aantal </td>
<td class="trackFormHeaderTitle" align="right">Bruto prijs </td>
<td class="trackFormHeaderTitle" align="right">Netto prijs </td>
<td class="trackFormHeaderTitle" align="right">Kostprijs </td>
<td class="trackFormHeaderTitle"> BTW</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="inpAll trackFormBodyCellLink">
<font size="2">BBA</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB">
<font size="2">Bezoek Bedrijfsarts</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">1,000</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">175,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">175,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">100,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB">
<font size="2">Hoog-tarief</font>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="inpLRB"> </td>
<td bgcolor="#FFFFFF" class="inpRB"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB"> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="inpLRB trackFormBodyCellLink">
<font size="2">REISKOSTEN</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB">
<font size="2">Reiskosten</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">1,000</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">75,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">75,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">0,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB">
<font size="2">Geen</font>
</td>
</tr>
</tbody>
</table>
<div style="margin: 100px 0;">
<hr />
</div>
<table class="table2">
<tr>
<td>
<table cellspacing="0" cellpadding="0" class="table2 no-wrap">
<tbody>
<tr height="19">
<td width="170"></td>
<td></td>
<td width="80"></td>
<td width="80"></td>
<td width="80"></td>
<td width="80"></td>
<td width="100"></td>
</tr>
<tr>
<td class="trackFormHeaderTitle">Artikel</td>
<td class="trackFormHeaderTitle">Omschrijving</td>
<td class="trackFormHeaderTitle" align="right">Aantal </td>
<td class="trackFormHeaderTitle" align="right">Bruto prijs </td>
<td class="trackFormHeaderTitle" align="right">Netto prijs </td>
<td class="trackFormHeaderTitle" align="right">Kostprijs </td>
<td class="trackFormHeaderTitle"> BTW</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="inpAll trackFormBodyCellLink">
<font size="2">BBA</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB">
<font size="2">Bezoek Bedrijfsarts</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">1,000</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">175,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">175,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB" align="right">
<font size="2">100,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpTRB">
<font size="2">Hoog-tarief</font>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="inpLRB"> </td>
<td bgcolor="#FFFFFF" class="inpRB"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB" align="right"> </td>
<td bgcolor="#FFFFFF" class="inpRB"> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="inpLRB trackFormBodyCellLink">
<font size="2">REISKOSTEN</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB">
<font size="2">Reiskosten</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">1,000</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">75,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">75,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB" align="right">
<font size="2">0,00</font>
</td>
<td bgcolor="#FFFFFF" class="inpRB">
<font size="2">Geen</font>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>

Solution
Don't use :not() because it's quirks make it unreliable and difficult with nested selectors.
Use an additional class to the other <table>s (ex. .wrap) and make it diametrically oppose .no-wrap.
Do not use a class that both types of <table> share (ie .table2).
Other Problems
<font> is HTML4 not HTML5, use a <span> and apply CSS to it.
Attributes cellspacing, cellpadding, bgcolor, and align are deprecated. Use CSS properties border-spacing, padding, background-color, and text-align.
In the example, there are 2 <table>s with .no-wrap (one of them is nested within another <table>) and 2 <table>s with .wrap (one of them is also nested within another <table>).
.table2 {
color: #000000;
width: 100%;
table-layout: fixed;
overflow: hidden;
border-spacing: 10px 5px;
border: 1px solid gray;
}
tbody > tr:first-of-type {height: 19px}
tr, td {outline: 1px dashed red;}
.wrap {outline: 3px dotted cyan}
.no-wrap {outline: 3px dotted lime}
#media only screen and (max-width: 1024px) {
table.wrap,
table.wrap > :is(thead, tbody, tfoot),
table.wrap > :is(thead, tbody, tfoot) > tr,
table.wrap > :is(thead, tbody, tfoot) > tr > :is(th, td) {display: block}
table.wrap > :is(thead, tbody, tfoot) > tr {margin: 20px}
table.wrap > tbody > tr:first-of-type {height:0}
table.wrap > :is(thead, tbody, tfoot) > tr > td {position:relative;margin:5px 0}
table.no-wrap,
table.no-wrap > :is(thead, tbody, tfoot),
table.no-wrap > :is(thead, tbody, tfoot) > tr,
table.no-wrap > :is(thead, tbody, tfoot) > tr > :is(th, td) {display: default;}
table.no-wrap > :is(thead, tbody, tfoot) > tr {margin: 0;}
table.no-wrap > tbody > tr:first-of-type {height: 19px;}
table.no-wrap > :is(thead, tbody, tfoot) > tr > td {position: static;margin: 0;}
}
<div class="track">
<table class="table2 no-wrap">
<tbody> <tr> <td width="170"></td> <td></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="100"></td> </tr> <tr> <td>Artikel</td> <td>Omschrijving</td> <td align="right">Aantal </td> <td align="right">Bruto prijs </td> <td align="right">Netto prijs </td> <td align="right">Kostprijs </td> <td> BTW</td> </tr> <tr> <td> <span>BBA</span> </td> <td> <span>Bezoek Bedrijfsarts</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>100,00</span> </td> <td> <span>Hoog-tarief</span> </td> </tr> <tr> <td> </td> <td> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td> </td> </tr> <tr> <td> <span>REISKOSTEN</span> </td> <td> <span>Reiskosten</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>0,00</span> </td> <td> <span>Geen</span> </td> </tr> </tbody> </table> <hr />
<table class="table2"> <tr> <td>
<table class="table2 no-wrap"> <tbody> <tr> <td width="170"></td> <td></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="100"></td> </tr> <tr> <td>Artikel</td> <td>Omschrijving</td> <td align="right">Aantal </td> <td align="right">Bruto prijs </td> <td align="right">Netto prijs </td> <td align="right">Kostprijs </td> <td> BTW</td> </tr> <tr> <td> <span>BBA</span> </td> <td> <span>Bezoek Bedrijfsarts</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>100,00</span> </td> <td> <span>Hoog-tarief</span> </td> </tr> <tr> <td> </td> <td> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td> </td> </tr> <tr> <td> <span>REISKOSTEN</span> </td> <td> <span>Reiskosten</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>0,00</span> </td> <td> <span>Geen</span> </td> </tr> </tbody> </table> </td> </tr> </table> <hr>
<table class="table2 wrap">
<tbody> <tr> <td width="170"></td> <td></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="100"></td> </tr> <tr> <td>Artikel</td> <td>Omschrijving</td> <td align="right">Aantal </td> <td align="right">Bruto prijs </td> <td align="right">Netto prijs </td> <td align="right">Kostprijs </td> <td> BTW</td> </tr> <tr> <td> <span>BBA</span> </td> <td> <span>Bezoek Bedrijfsarts</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>100,00</span> </td> <td> <span>Hoog-tarief</span> </td> </tr> <tr> <td> </td> <td> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td> </td> </tr> <tr> <td> <span>REISKOSTEN</span> </td> <td> <span>Reiskosten</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>0,00</span> </td> <td> <span>Geen</span> </td> </tr> </tbody> </table>
<table class="table2"> <tr> <td>
<table class="table2 wrap"> <tbody> <tr> <td width="170"></td> <td></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="80"></td> <td width="100"></td> </tr> <tr> <td>Artikel</td> <td>Omschrijving</td> <td align="right">Aantal </td> <td align="right">Bruto prijs </td> <td align="right">Netto prijs </td> <td align="right">Kostprijs </td> <td> BTW</td> </tr> <tr> <td> <span>BBA</span> </td> <td> <span>Bezoek Bedrijfsarts</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>175,00</span> </td> <td align="right"> <span>100,00</span> </td> <td> <span>Hoog-tarief</span> </td> </tr> <tr> <td> </td> <td> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td align="right"> </td> <td> </td> </tr> <tr> <td> <span>REISKOSTEN</span> </td> <td> <span>Reiskosten</span> </td> <td align="right"> <span>1,000</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>75,00</span> </td> <td align="right"> <span>0,00</span> </td> <td> <span>Geen</span> </td> </tr> </tbody> </table> </td> </tr> </table>
</div>

Related

Aligning td in nested table

Hi working to create a newsletter template. At the moment I am stuck as i am unable to change the alignment of the td
I have attached a CodePen, but below is the code! Firstly I don't understand why the elements on the right are aligned left-center? Eitherway I need them to be top-center. Any ideas?
<table align="center" width="690px" bgcolor="#d3e1a3" border="1">
<tr>
<td>
<table width="297px" height="100%">
<tr>
<td>
<img src="https://www.naturimgarten.at/assets/images/4/Streicher-ff65c810.jpg" style="max-width:297px;" alt="placeholder" mc:edit="image">
</td>
</tr>
</table>
</td>
<td>
<table width="393px" align="center">
<tr>
<td>
name
</td>
</tr>
<tr>
<td>
country
</td>
</tr>
<tr>
<td>text</td>
</tr>
</table>
</td>
</tr>
</table>
Mind you this is for a newsletter template so think web 1998, most of the fancy web stuff is not usefull here!
<table align="center" width="690px" bgcolor="#d3e1a3" border="1">
<tr>
<td>
<table width="297px" height="100%">
<tr>
<td>
<img src="https://www.naturimgarten.at/assets/images/4/Streicher-ff65c810.jpg" style="max-width:297px;" alt="placeholder" mc:edit="image">
</td>
</tr>
</table>
</td>
<td style="vertical-align:top; text-align:center">
<table width="393px" align="center">
<tr>
<td>
name
</td>
</tr>
<tr>
<td>
country
</td>
</tr>
<tr>
<td>text</td>
</tr>
</table>
</td>
</tr>
</table>
You have put align="center" in the td tag.
<table align="center" width="690px" bgcolor="#d3e1a3" border="1">
<tr>
<td>
<table width="297px" height="100%">
<tr>
<td align="center" >
<img src="https://www.naturimgarten.at/assets/images/4/Streicher-ff65c810.jpg" style="max-width:297px;" alt="placeholder" mc:edit="image">
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;">
<table width="393px" align="center">
<tr>
<td align="center" >
name
</td>
</tr>
<tr>
<td align="center" >
country
</td>
</tr>
<tr>
<td align="center" >text</td>
</tr>
</table>
</td>
</tr>
</table>

How can I make this HTML / CSS file UltraHD / 4k friendly in a CHtmlView?

I have a simple HTML / CSS file.
<style type="text/css">
table {
font-family: "Arial Unicode MS";
border-collapse: collapse;
width: 100%;
}
thead tr td {
font-family: "Arial Unicode MS";
font-weight: 700;
font-size: 12pt;
background-color: gray;
}
td {
font-family: "Arial Unicode MS";
border-bottom: 1px black solid;
border-top: 1px black solid;
border-left: 2px black solid;
border-right: 2px black solid;
}
h1 {
font-family: "Arial Unicode MS";
text-align: center;
}
.columnStudyPoint {
}
.columnDate {
text-align: center;
/*width: 10%;*/
}
.textStudyPoint {
font-weight:700;
}
.textStudyDescription {
}
#media print {
thead {
display: table-header-group;
}
table tbody tr td:before,
table tbody tr td:after {
content : "" ;
height : 4px ;
display : block ;
}
}
</style>
<!DOCTYPE html PUBLIC "//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="CounselForm.css" rel="stylesheet" type="text/css" />
<title>Student Counsel Forms</title>
</head>
<body>
<h1>Counsel Form for Happy Face</h1>
<table align="center" cellpadding="2" cellspacing="0">
<colgroup>
<col width="100%" /><col /><col />
</colgroup>
<thead>
<tr>
<td class="columnStudyPoint">Study Point</td>
<td class="columnDate">Date Assigned</td>
<td class="columnDate">Date Completed</td>
</tr>
</thead>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">1</span> <span class="textStudyDescription">Accurate
Reading</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">2</span> <span class="textStudyDescription">Words
Clearly Spoken</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">3</span> <span class="textStudyDescription">Correct
Pronunciation</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">4</span> <span class="textStudyDescription">Fluent
Delivery</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">5</span> <span class="textStudyDescription">Appropriate
Pausing</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">6</span> <span class="textStudyDescription">Proper
Sense Stress</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">7</span> <span class="textStudyDescription">Principal
Ideas Emphasized</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">8</span> <span class="textStudyDescription">Suitable
Volume</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">9</span> <span class="textStudyDescription">Modulation</span>
</td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">10</span> <span class="textStudyDescription">Enthusiasm</span>
</td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">11</span> <span class="textStudyDescription">Warmth
And Feeling</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">12</span> <span class="textStudyDescription">Gestures
and Facial Expressions</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">13</span> <span class="textStudyDescription">Visual
Contact</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">14</span> <span class="textStudyDescription">Naturalness</span>
</td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">15</span> <span class="textStudyDescription">Good
Personal Appearance</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">16</span> <span class="textStudyDescription">Poise</span>
</td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">17</span> <span class="textStudyDescription">Use
of Microphone</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">18</span> <span class="textStudyDescription">Use
of Bible in Replying</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">19</span> <span class="textStudyDescription">Use
of Bible Encouraged</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">20</span> <span class="textStudyDescription">Scriptures
Effectively Introduced</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">21</span> <span class="textStudyDescription">Scriptures
Read With Proper Emphasis</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">22</span> <span class="textStudyDescription">Scriptures
Correctly Applied</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">23</span> <span class="textStudyDescription">Practical
Value Made Clear</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">24</span> <span class="textStudyDescription">Choice
of Words</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">25</span> <span class="textStudyDescription">Use
of an Outline</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">26</span> <span class="textStudyDescription">Logical
Development of Material</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">27</span> <span class="textStudyDescription">Extemporaneous
Delivery</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">28</span> <span class="textStudyDescription">Conversational
Manner</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">29</span> <span class="textStudyDescription">Voice
Quality</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">30</span> <span class="textStudyDescription">Interest
Shown in the Other Person</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">31</span> <span class="textStudyDescription">Respect
Shown to Others</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">32</span> <span class="textStudyDescription">Expressed
With Conviction</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">33</span> <span class="textStudyDescription">Tactful
Yet Firm</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">34</span> <span class="textStudyDescription">Upbuilding
And Positive</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">35</span> <span class="textStudyDescription">Repetition
for Emphasis</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">36</span> <span class="textStudyDescription">Theme
Developed</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">37</span> <span class="textStudyDescription">Main
Points Made to Stand Out</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">38</span> <span class="textStudyDescription">Interest
- Arousing Introduction</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">39</span> <span class="textStudyDescription">Effective
Conclusion</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">40</span> <span class="textStudyDescription">Accuracy
of Statement</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">41</span> <span class="textStudyDescription">Understandable
to Others</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">42</span> <span class="textStudyDescription">Informative
to Your Audience</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">43</span> <span class="textStudyDescription">Use
of Assigned Material</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">44</span> <span class="textStudyDescription">Effective
Use of Questions</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">45</span> <span class="textStudyDescription">Illustrations
/ Examples That Teach</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">46</span> <span class="textStudyDescription">Illustrations
From Familiar Situations</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">47</span> <span class="textStudyDescription">Effective
Use of Visual Aids</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">48</span> <span class="textStudyDescription">Reasoning
Manner</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">49</span> <span class="textStudyDescription">Sound
Arguments Given</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">50</span> <span class="textStudyDescription">Effort
To Reach the Heart</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
<tr>
<td class="columnStudyPoint"><span class="textStudyPoint">51</span> <span class="textStudyDescription">Accurately
Timed, Properly Proportioned</span> </td>
<td class="columnDate"> </td>
<td class="columnDate"> </td>
</tr>
</table>
</body>
</html>
My CSS file sets font sizes and line thicknesses. These are what I am interested in.
The results look fine on my computer running a high resolution (but not UltraHD etc.). I don't have a UltraHD monitor in order to test this out to see if it will work correctly.
Ultimately this webpage will be shown in a CHtmlView browser control so it does not need to be compatible with all mobile devices.
Thank you.
Update
Here you see it in context in my application:
I note the comments state that I should not be specifying font heights myself. I saw this:
https://websemantics.uk/articles/font-size-conversion/
It refers to 1em for 12pt.
Update
Someone has just tried my CHtmlView application on a Ultra HD computer. The preview is fine. But the printing to PDF or a Printer looks like this:
It is cropped.
If I get them to open the same file directly in Internet Explorer and print it it prints correctly to the printer and PDF.
So why is CHtmlView playing up?

Simple one. How to remove horizontal gap between floating divs with tables inside

Ok, so, I have this simple HTML with DIVS, and tables inside those DIVS. I want them to be next to each other so I used CSS float. I can't remove the gap between the tables, and I want them to be separated just as they are.
Any ideas?
#charset "utf-8";
/* CSS Document */
div {
float: left;
}
<div>
<div>
<table width="328" height="450" border="0">
<tr>
<td colspan="3" height="41"> </td>
</tr>
<tr>
<td colspan="3">Custo benefício</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3">Intermediário</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3">Alto Desempenho</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" height="8">RODAPE</td>
</tr>
</table>
</div>
<div>
<table width="226" height="450" border="0">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div>
<div>
<table width="163" height="450" border="0">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Viseiras e reparos</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Motoclubes</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div>
<div>
<table width="263" height="450" border="0">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div>
</div>
Here is how it looks:
ScreenShot
Try adding
cellpadding="0" cellspacing="0"
to all of your table tags. This should remove any small spaces you might be having. It should look something like this:
<table width="328" height="450" border="0" cellpadding="0" cellspacing="0">
Here's a fiddle: http://jsfiddle.net/54aq3p86/
(I added a border in the fiddle so you could tell where the border's are)
Take a look At these code I just change the inline div style.
And Make the table border 1px to visible
Untitled Document
<body>
<div>
<div style="float:left">
<table width="328" height="450" border="1px">
<tr>
<td colspan="3" height="41"> </td>
</tr>
<tr>
<td colspan="3">Custo benefício</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3">Intermediário</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3">Alto Desempenho</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" height="8">RODAPE</td>
</tr>
</table>
</div>
<div style="float:left">
<table width="226" height="450" border="1px">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div>
<div style="float:left">
<table width="163" height="450" border="1px">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Viseiras e reparos</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Motoclubes</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div>
<div style="float:left">
<table width="263" height="450" border="1px">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div>
<div style="clear:both"></div>
</body>
</html>
Im guessing you only want to remove those two gaps right!?, not the ones provided by the cells!
here is a jsfiddle for you.
http://jsfiddle.net/4gLm20zq/1/1
Just add the cellpadding and cellspacing table atributes, just like I did in the jsfiddle example. I also added a class name to each div except for the main parent div. and added some new css rules. Give it a try and let me know if this works for you.
Here is the CSS
<style>
div.column {
float: left;
}
div.column:nth-child(even) {
margin: 0px -2px;
}
td {
background-color: #CCC;
}
</style>
And here is the html
<div>
<div class="column">
<table width="328" height="450" border="0" cellpadding="0" cellspacing="2">
<tr>
<td colspan="3" height="41"> </td>
</tr>
<tr>
<td colspan="3">Custo benefício</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3">Intermediário</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3">Alto Desempenho</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" height="8">RODAPE</td>
</tr>
</table>
</div><div class="column">
<table width="226" height="450" border="0" cellpadding="0" cellspacing="2">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div><div class="column">
<table width="163" height="450" border="0" cellpadding="0" cellspacing="2">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Viseiras e reparos</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>Motoclubes</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div><div class="column">
<table width="263" height="450" border="0" cellpadding="0" cellspacing="2">
<tr>
<td height="41"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="8">RODAPE</td>
</tr>
</table>
</div>
</div>

How to divide a HTML table using percentages

I am using a HTML template in my website that send emails and one of the sections in the email uses HTML tables.
How can i use HTML to get the following output
Here is a fiddle to DEMO what i have tried
Here is my HTML code
<table width="100%" cellspacing="3" cellpadding="0" style="border:1px solid black;border-collapse:collapse">
<tbody>
<tr>
<td colspan="3" style="background-color:#d9eeff;"><strong>Order Details</strong>
</td>
</tr>
<tr>
<td> <strong>Order ID:</strong>
</td>
<td>XSL VALUE</td>
</tr>
<tr>
<td> <strong>Date:</strong>
<br />
<br />
</td>
<td>XSL VALUE
<br />
<br />
</td>
</tr>
<tr>
<td> <strong>Payment Method:</strong>
<br />
<br />
</td>
<td>XSL VALUE
<br />
<br />
</td>
</tr>
<tr>
<td> <strong>Shipping Method:</strong>
<br />
<br />
</td>
<td>XSL VALUE
<br />
<br />
</td>
</tr>
</tbody>
</table>
You need to change your HTML to set colspan to 2 and also add a thead in order to maintain correct semantics. Other than that, as is the joy of HTML email, you're likely best applying your CS inline...shudder.
Demo Fiddle
HTML
<table width="100%" cellspacing="3" cellpadding="0" style="border:1px solid black;border-collapse:collapse;font-family:arial;font-size:12px;">
<thead>
<tr style='background:lightgray;'>
<td colspan="2" style="padding:5px;font-weight:bold;">Order Details</td>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:5px 0 0 5px;font-weight:bold;border-right:1px solid lightgray;width:50%;">Order ID: <span style='font-weight:normal;'>(value)</span>
</td>
<td style='padding-left:20px;'></td>
</tr>
<tr>
<td style="padding-left:5px;font-weight:bold;border-right:1px solid lightgray;width:50%;">Date: <span style='font-weight:normal;'>(value)</span>
</td>
<td style='padding-left:20px;font-weight:bold;'>Email: <span style='font-weight:normal;'>(value)</span>
</td>
</tr>
<tr>
<td style="padding-left:5px;font-weight:bold;border-right:1px solid lightgray;width:50%;">Payment Method: <span style='font-weight:normal;'>(value)</span>
</td>
<td style='padding-left:20px;font-weight:bold;'>Telephone: <span style='font-weight:normal;'>(value)</span>
</td>
</tr>
<tr>
<td style="padding:0 0 5px 5px;font-weight:bold;border-right:1px solid lightgray;width:50%;">Shipping Method: <span style='font-weight:normal;'>(value)</span>
</td>
<td style='padding-left:20px;'></td>
</tr>
</tbody>
</table>
<HTML>
<BODY>
<table width="100%" cellspacing="3" cellpadding="0" style="border:1px solid black;border-collapse:collapse">
<thead>
<td colspan="3" style="background-color:#d9eeff;"><strong>Order Details</strong>
</td>
</thead>
<tbody>
<tr>
<td>Order Id:<td>
<td></td>
</tr>
<tr>
<td>Date:<td>
<td>Email:</td>
</tr>
<tr>
<td>Payment Method:<td>
<td>Telephone:</td>
</tr>
<tr>
<td>Shipping Method:<td>
<td></td>
</tr>
</tbody>
</table>
</BODY>
</HTML>
USE THIS HTML CODE:
http://jsfiddle.net/mkginfo/vWy6R/
<table width="100%" cellspacing="3" cellpadding="0" style="border:1px solid black;border-collapse:collapse">
<tbody>
<tr>
<td colspan="3" style="background-color:#d9eeff;"><strong>Order Details</strong>
</td>
</tr>
<tr>
<td colspan="2" width="50%">
<table>
<tr>
<td> <strong>Order ID:</strong>
</td>
<td>XSL VALUE</td>
</tr>
<tr>
<td> <strong>Date:</strong>
</td>
<td>XSL VALUE
</td>
</tr>
<tr>
<td> <strong>Payment Method:</strong>
</td>
<td>XSL VALUE
</td>
</tr>
<tr>
<td> <strong>Shipping Method:</strong>
</td>
<td>XSL VALUE
</td>
</tr>
</table>
</td>
<td colspan="2" width="50%">
<table>
<tr>
<td> <strong></strong></td>
<td></td>
</tr>
<tr>
<td> <strong>Email:</strong>
</td>
<td>XSL VALUE
</td>
</tr>
<tr>
<td> <strong>Telephone:</strong>
</td>
<td>XSL VALUE
</td>
</tr>
<tr>
<td> <strong></strong>
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
you need to count your TD Tags
as you specified td colspan="3" in the first row
all other rows should at least have 3 td tags or td tags specifiying a colspan value.
and my advice use CSS instead. If not possible count how much columns you need and respect the previous rules
Try this
<table width="100%" cellspacing="3" cellpadding="0" style="border:1px solid black;border-collapse:collapse;font-family:arial;font-size:12px;">
<thead>
<tr style='background:#c0c0c0;'>
<td colspan="2" style="padding:5px;"><strong>Order Details</strong>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:5px 0 0 5px;font-weight:bold;border-right:1px solid black;">Order ID:</td>
<td style="padding:0 0 0 5px;">XSL VALUE</td>
</tr>
<tr>
<td style="padding-left:5px;font-weight:bold;border-right:1px solid black;">Date:</td>
<td style="padding:0 0 0 5px;">XSL VALUE</td>
</tr>
<tr>
<td style="padding-left:5px;font-weight:bold;border-right:1px solid black;">Payment Method:</td>
<td style="padding:0 0 0 5px;">XSL VALUE</td>
</tr>
<tr>
<td style="padding:0 0 5px 5px;font-weight:bold;border-right:1px solid black;">Shipping Method:</td>
<td style="padding:0 0 0 5px;">XSL VALUE</td>
</tr>
</tbody>
</table>
Here is a working fiddle
Working Fiddle
HTML Code
<table width="100%" cellspacing="3" cellpadding="0" style="border:1px solid black;border-collapse:collapse">
<tbody>
<tr>
<td colspan="2" style="background-color:#d9eeff;"><strong>Order Details</strong></td>
</tr>
<tr>
<td>
<table>
<tr>
<td> <strong>Order ID:</strong>
</td>
<td>XSL VALUE</td>
</tr>
<tr>
<td> <strong>Date:</strong>
<br />
<br />
</td>
<td>XSL VALUE
<br />
<br />
</td>
</tr>
<tr>
<td> <strong>Payment Method:</strong>
<br />
<br />
</td>
<td>XSL VALUE
<br />
<br />
</td>
</tr>
<tr>
<td> <strong>Shipping Method:</strong>
<br />
<br />
</td>
<td>XSL VALUE
<br />
<br />
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td> <strong>Email:</strong>
</td>
<td>XSL VALUE</td>
<tr>
<td> <strong>Telephone:</strong>
</td>
<td>XSL VALUE</td>
</tr>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
Hope this might help..!!

How to make a table that looks like this in html or make a tableless one [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I have a to present data in html with headers. Below is the image of part of the header which i am struggling with.
I have managed to rotate the text but the problem is there overlap.
This is the code of the whole structure.
<style type="text/css"> .text-rotation {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
height:inherit;
}
</style>
</head>
<body>
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="1">
<tr>
<td rowspan="5"> </td>
<td rowspan="5" align="center" valign="bottom">Code</td>
<td rowspan="5" align="center" valign="bottom">Change</td>
<td rowspan="5" align="center" valign="bottom">Description</td>
<td colspan="6" align="center" bgcolor="#FF6666">STOCK RANGE</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#66CC00" >SPHERICAL</td>
<td colspan="2" align="center" bgcolor="#FFCC00" >SPH/CYL-/-</td>
<td colspan="2" align="center" bgcolor="#0066CC">SPH/CYL+/-</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td rowspan="3" align="center" bgcolor="#66CC00" class="text-rotation">MINUS</td>
<td rowspan="3" align="center" bgcolor="#66CC00" class="text-rotation">PLUS</td>
<td rowspan="3" align="center" bgcolor="#FFCC00" class="text-rotation">MINUS</td>
<td rowspan="3" align="center" bgcolor="#FFCC00" class="text-rotation">PLUS</td>
<td rowspan="3" align="center" bgcolor="#0066CC" class="text-rotation">PLUS</td>
<td rowspan="3" align="center" bgcolor="#0066CC" class="text-rotation">MINUS</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
A quick mock-up:
<table border="1">
<tr>
<td colspan="6">STOCK RANGE</td>
<td colspan="11">LENS PROPERTIES</td>
</tr>
<tr>
<td colspan ="2">SPHERICAL</td>
<td colspan ="2">SPH/CYL</td>
<td colspan ="2">SPH/CYL</td>
<td rowspan="2">Stock</td>
<td rowspan="2">Disclaimer</td>
<td rowspan="2">Index</td>
<td rowspan="2">UV Coating</td>
<td rowspan="2">FOOBAR</td>
<td rowspan="2">FOOBAR</td>
<td rowspan="2">FOOBAR</td>
<td rowspan="2">FOOBAR</td>
<td rowspan="2">FOOBAR</td>
<td rowspan="2">FOOBAR</td>
<td rowspan="2">FOOBAR</td>
</tr>
<tr>
<td>LEFT1</td>
<td>LEFT2</td>
<td>LEFT3</td>
<td>LEFT4</td>
<td>LEFT4</td>
<td>LEFT5</td>
</tr>
<tr>
<td>DATA_LEFT_1</td>
<td>DATA_LEFT_2</td>
<td>DATA_LEFT_3</td>
<td>DATA_LEFT_4</td>
<td>DATA_LEFT_5</td>
<td>DATA_LEFT_6</td>
<td>DATA_RIGHT_1</td>
<td>DATA_RIGHT_2</td>
<td>DATA_RIGHT_3</td>
<td>DATA_RIGHT_4</td>
<td>DATA_RIGHT_5</td>
<td>DATA_RIGHT_6</td>
<td>DATA_RIGHT_7</td>
<td>DATA_RIGHT_8</td>
<td>DATA_RIGHT_9</td>
<td>DATA_RIGHT_10</td>
<td>DATA_RIGHT_11</td>
</tr>
</table>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
EDIT 2: Some visual of this: jsFiddle
EDIT 3: Some new visuals with the other answer incorporated: jsFiddle.
Rotating an item in non legacy-IE calculates it's properties before rotating the element. This means the whole item and background will be shifted outside the document flow, probably not what you want in a table. Try rotating the cell content, not the cell itself, like so:
.text-rotation > * {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
height:inherit;
}
... and adding a generic display:block wrapper around the cell content ...
<td rowspan="3" align="center" bgcolor="#66CC00" class="text-rotation"><div>MINUS</div></td>
<td rowspan="3" align="center" bgcolor="#66CC00" class="text-rotation"><div>PLUS</div></td>
<td rowspan="3" align="center" bgcolor="#FFCC00" class="text-rotation"><div>MINUS</div></td>
<td rowspan="3" align="center" bgcolor="#FFCC00" class="text-rotation"><div>PLUS</div></td>
<td rowspan="3" align="center" bgcolor="#0066CC" class="text-rotation"><div>PLUS</div></td>
<td rowspan="3" align="center" bgcolor="#0066CC" class="text-rotation"><div>MINUS</div></td>