Remove table background in one cell - css

Sorry if the title isn't descriptive, I didn't know how to word it. Here's the table in question.
Is it possible for me to remove the white border (the background of the table) from this upper-left cell? I still want this white background between the rest of the cells, but in that upper-left I want it removed. Here's how I want it to look.
My initial thought is to have some ::after pseudo-element on that cell that has some border or padding that can cover that gap between the cell and page background, but I don't know how to do that. Any ideas?
Here's the CSS on this page.
body{
background: #C3DEF2;
font-family: Noto Sans, Roboto, Helvetica, Arial, sans-serif;
}
table{
background: white;
table-layout: fixed;
}
tr:nth-child(even){
background: lightgray;
}
td{
padding: 20px;
}
td.corner{ /* cell in upper-left corner */
background: #C3DEF2;
}
.head1{ /* top row */
text-align: center;
}
.head2{ /* leftmost column */
text-align: right;
}
.head1, .head2{
background: lightblue;
text-transform: uppercase;
font-weight: 600;
}
As requested, here's some of the HTML relating to this part of the table.
<table id="the_table" width="100%">
<tbody>
<tr class="head1">
<td class="corner"></td>
<td>Candidate 1</td>
<td>Candidate 2</td>
</tr>
<tr>
<td class="head2">Education</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="head2">Election Reform</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="head2">Environment</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="head2">Foreign Policy</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
Probably more importantly, where does this border come from? It's the white background of the table, but what causes that space between the cells?

Here's a quick solution:
HTML:
<table>
<tr>
<td style="border: 1px inset white;">1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
</table>
CSS:
table {
margin: 20px;
border-collapse: collapse;
border-spacing: 0;
}
td {
width: 40px;
height: 40px;
border: 1px solid black;
text-align: center;
}
td:hover {
border: 1px solid red;
}
DEMO:
https://liveweave.com/7eIF6k

Related

How do I give a table a border radius and remove double borders in th and td elements?

I found out that you can't style thead, tr, or tbody. What I want to do is have a 2px white border between the cells and doesn't over lap and give the table a border radius where the table cells don't break the radius.
body {
background-color: blue;
color: white;
}
table {
border-collapse: separate !important;
width: 100%;
border: 2px solid white;
border-radius: 12px !important;
}
th {
padding : 12px;
border: 2px solid white;
}
td {
padding : 12px;
border: 2px solid white;
}
<table id="user-table">
<thead>
<tr>
<th>id</th>
<th>name</th>
<th>password</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Kyle</td>
<td>bb5dc8842ca31d4603d6aa11448d1654</td>
</tr>
<tr>
<td>2</td>
<td>Brit</td>
<td>953f893eaed2098219f31f68947be559</td>
</tr>
<tr>
<td>3</td>
<td>Trevor</td>
<td>bb5dc8842ca31d4603d6aa11448d1654</td>
</tr>
<tr>
<td>4</td>
<td>Justin</td>
<td>953f893eaed2098219f31f68947be559</td>
</tr>
<tr>
<td>5</td>
<td>Dave</td>
<td>953f893eaed2098219f31f68947be559</td>
</tr>
</tbody>
</table>
Is there a way of going about this?
Also I tried to add the reset I was using to the code and everything broke because I don't know how to add it before the css that runs in the code snippet example:
https://meyerweb.com/eric/tools/css/reset/reset.css
Its isn't quite true that you cant style th, tr, td elements in a table. You can see below how the background colour of th & tr is changed.
You can target cells in the corners through pseudo classes such as :first-child, :last-child and add individual border radius property.
In your sample code I've used these properties to mention the borders.
border-top-left-radius
border-top-right-radius
border-bottom-left-radius
border-bottom-right-radius
body {
background-color: blue;
color: white;
}
table {
border-collapse: separate !important;
width: 100%;
border: 2px solid white;
border-radius: 12px !important;
}
th {
padding : 12px;
border: 2px solid white;
background: red;
}
th:first-child {
border-top-left-radius: 10px;
}
th:last-child {
border-top-right-radius: 10px;
}
td {
padding : 12px;
border: 2px solid white;
}
tr:nth-child(even) {
background: grey;
}
tr:last-child td:first-child {
border-bottom-left-radius: 10px;
}
tr:last-child td:last-child {
border-bottom-right-radius: 10px;
}
<table id="user-table">
<thead>
<tr>
<th>id</th>
<th>name</th>
<th>password</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Kyle</td>
<td>bb5dc8842ca31d4603d6aa11448d1654</td>
</tr>
<tr>
<td>2</td>
<td>Brit</td>
<td>953f893eaed2098219f31f68947be559</td>
</tr>
<tr>
<td>3</td>
<td>Trevor</td>
<td>bb5dc8842ca31d4603d6aa11448d1654</td>
</tr>
<tr>
<td>4</td>
<td>Justin</td>
<td>953f893eaed2098219f31f68947be559</td>
</tr>
<tr>
<td>5</td>
<td>Dave</td>
<td>953f893eaed2098219f31f68947be559</td>
</tr>
</tbody>
</table>

CSS table styling - special format

I need a table styling like below, where the milestone label is displayed without any spacing with the table content itself wile on the right of it I have a couple of additional information displayed in cells with spacing between them and below content.
divs can work as well.
You can create the cells at the top right as seperate tables with position: absolute and make the cell under those (the top right of the large table, spanning several columns) invisible as shown below.
table {
border-collapse: collapse;
border: none;
}
th,
td {
border: 1px solid blue;
padding: 15px 20px;
}
th {
background: #ccc;
border: 1px solid red;
}
.head1 {
background: #aaa;
border-color: green;
}
.nohead {
display: none;
}
table.t1 {
margin-top: 20px;
}
table.t2 {
position: absolute;
right: 180px;
top: 10px;
}
.t2 td {
padding: 2px 15px;
width: 50px;
text-align: center;
border-color: orange;
}
<table class="t1">
<tr>
<td colspan="3" class="head1">The main header</td>
<td colspan="4" class="nohead">nothing to see</td>
</tr>
<tr>
<th>Cell 1</th>
<th>Cell 2</th>
<th>Cell 3</th>
<th>Cell 4</th>
<th>Cell 5</th>
<th>Cell 6</th>
<th>Cell 7</th>
</tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
<td>Cell 5</td>
<td>Cell 6</td>
<td>Cell 7</td>
</tr>
</table>
<table class="t2">
<tr>
<td>A1</td>
<td>A2</td>
</tr>
<tr>
<td>B1</td>
<td>B2</td>
</tr>
</table>

How do i create a responsive table for small screen sizes less than 600

I need help scaling down the overall size of the table to fit all screen sizes, most sizes I've covered but can't scale down for mobile screen sizes 600 or less. I mostly use flex box in the media query but can't get the size down less that 600. i'm missing something but can't put my finger on it.
See my code and please advise what i'm missing. any help i'm grateful for.
I'll kick myself i'm sure..
.table {
border-collapse: collapse;
border-spacing: 0;
margin: 0px auto;
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.table td {
font-family: Arial, sans-serif;
font-size: 14px;
padding: 10px 5px;
border-style: solid;
border-width: 1px;
overflow: hidden;
word-break: normal;
border-color: black;
}
.table th {
font-family: Arial, sans-serif;
font-size: 14px;
font-weight: normal;
padding: 10px 5px;
border-style: solid;
border-width: 1px;
overflow: hidden;
word-break: normal;
border-color: black;
}
.table .index-table {
border-color: inherit;
text-align: center;
vertical-align: middle
}
#media screen and (max-width: 767px) and (max-width: 1025px)and (max-width: 300px) {
.table {
overflow-x: auto;
}
.index-table {
width: auto !important;
}
}
<table class="table">
<tr>
<th class="index-table" colspan="15">Seattle</th>
</tr>
<tr>
<td class="index-table" colspan="15">Hinged Shutter Specification</td>
</tr>
<tr>
<td class="index-table" colspan="3" rowspan="3">Louver Size</td>
<td class="index-table" colspan="8">Width</td>
<td class="index-table" colspan="4" rowspan="2">Height</td>
</tr>
<tr>
<td class="index-table" colspan="2" rowspan="2">Min</td>
<td class="index-table" colspan="6">Max</td>
</tr>
<tr>
<td class="index-table" colspan="2">Single Hung</td>
<td class="index-table" colspan="2">Bi-Fold</td>
<td class="index-table" colspan="2">Multi-Fold</td>
<td class="index-table" colspan="2">Min.</td>
<td class="index-table" colspan="2">Max*</td>
</tr>
<tr>
<td class="index-table" colspan="3" rowspan="2">47mm</td>
<td class="index-table" colspan="2" rowspan="10">152mm</td>
<td class="index-table" colspan="2" rowspan="2">600mm</td>
<td class="index-table" colspan="2" rowspan="10">600mm</td>
<td class="index-table" colspan="2" rowspan="10">N/A</td>
<td class="index-table" colspan="2" rowspan="10">250mm</td>
<td class="index-table" colspan="2" rowspan="10">300mm</td>
</tr>
<tr>
</tr>
<tr>
<td class="index-table" colspan="3" rowspan="2">63mm</td>
<td class="index-table" colspan="2" rowspan="8">750mm</td>
</tr>
<tr>
</tr>
<tr>
<td class="index-table" colspan="3" rowspan="2">76mm</td>
</tr>
<tr>
</tr>
<tr>
<td class="index-table" colspan="3" rowspan="2">89mm</td>
</tr>
<tr>
</tr>
<tr>
<td class="index-table" colspan="3" rowspan="2">114mm</td>
</tr>
<tr>
</tr>
</table>
All you need to do is making your website/page mobile friendly. To do that you have to setup the viewport, You can do so by adding:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
in the head tag in your html file and your good to go. Read more about it here.

How to get the inner table ignore the inherited styles

I have seen a few similar questions but they don't match what I am after. I have a situation where a table can have inner tables. However, I like the inner table to ignore the styles defined by "myTable". How can I do this?
Preferably, without adding a CSS for inner table. Or at least without adding a new class or reference to an ID for the inner table. Thank you for any help.
#myTable td, #myTable th {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
word-wrap: break-word;
}
#myTable th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #00bf11;
color: white;
}
#myTable {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd;
font-size: 12px;
font-family: Verdana, sans-serif;
table-layout: fixed;
}
<html>
<body>
<table id="myTable">
<tr class="header">
<th onclick="sortTable(0)" style="width:6%;">Col1</th>
<th onclick="sortTable(1)" style="width:9%;">Col2</th>
<th onclick="sortTable(2)" style="width:85%;">Col3</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>
<table class="table table-bordered">
<tbody>
<tr>
<th>Col One</th>
<th>Col Two</th>
<th>Col Three</th>
</tr>
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
</tr>
</tbody>
</table>
</td>
</table>
</body>
</html>
Deryck has the right answer altough it's not complete because of browser implementation and missing tr
#myTable > tbody > tr > td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
word-wrap: break-word;
}
#myTable > tbody > tr > th {
border: 1px solid #ddd;
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #00bf11;
color: white;
}
#myTable {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd;
font-size: 12px;
font-family: Verdana, sans-serif;
table-layout: fixed;
}
<html>
<body>
<table id="myTable">
<tr class="header">
<th onclick="sortTable(0)" style="width:6%;">Col1</th>
<th onclick="sortTable(1)" style="width:9%;">Col2</th>
<th onclick="sortTable(2)" style="width:85%;">Col3</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>
<table class="table table-bordered">
<tbody>
<tr>
<th>Col One</th>
<th>Col Two</th>
<th>Col Three</th>
</tr>
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
</tr>
</tbody>
</table>
</td>
</table>
</body>
</html>
If you are trying to make it so the styles you have there don't apply to anything but the specific children (tr, th, etc at the top level) you can use > to specify the style to only apply to the direct children of #myTable
#myTable > td, #myTable > th {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
word-wrap: break-word;
}
#myTable > th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #00bf11;
color: white;
}
#myTable {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd;
font-size: 12px;
font-family: Verdana, sans-serif;
table-layout: fixed;
}
<html>
<body>
<table id="myTable">
<tr class="header">
<th onclick="sortTable(0)" style="width:6%;">Col1</th>
<th onclick="sortTable(1)" style="width:9%;">Col2</th>
<th onclick="sortTable(2)" style="width:85%;">Col3</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>
<table class="table table-bordered">
<tbody>
<tr>
<th>Col One</th>
<th>Col Two</th>
<th>Col Three</th>
</tr>
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
</tr>
</tbody>
</table>
</td>
</table>
</body>
</html>

How can i get yellow lines like the flag in sweden HTML

I am new to html and css so i am not that good. The problem i have right now is that i have created a nested table with two tables. I got four columns with the blue color. But the problem is that i dont know how to get yellow lines like the flag has. The code i come so far is below.
<!DOCTYPE html>
<html>
<head>
<style>
table.blue {background-color: #0000ff;}
table.yellow {background-color: #ffff00;}
</style>
<title>HTML Table</title>
</head>
<body>
<table class="yellow" border="10" width="320px">
<tr>
<td>
<table class="blue" border="1" width="100%">
<tr>
<td height="40">blue</td>
<td>blue</td>
</tr>
<tr>
<td height="40">blue</td>
<td>blue</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</body>
</html>
(Image of Swedish Flag)
Not table but just div https://jsfiddle.net/2Lzo9vfc/134/
CSS
.flag {
background-color: #006AA7;
width: 500px;
height: 300px;
position: relative;
}
.flag::before {
background-color: #FECC00;
content: "";
height: 15%;
left: 0;
margin-top: -5%;
position: absolute;
top: 50%;
width: 100%;
}
.flag::after {
background-color: #FECC00;
content: "";
height: 100%;
left: 30%;
margin-left: -5%;
position: absolute;
top: 0;
width: 9%;
}
HTML
<div class="flag"></div>
It seems overly complicated to use tables for this. You can very simply achieve the desired result with absolute positioning. Notice how much less code this is:
.flag {
background: #0000ff;
position: relative;
width: 400px;
height: 300px;
}
.vertical {
background: #ffff00;
position: absolute;
left: 30%;
width: 60px;
height: 300px;
}
.horizontal {
background: #ffff00;
position: absolute;
top: 50%;
width: 400px;
height: 60px;
margin-top: -30px;
}
<div class="flag">
<div class="vertical"></div>
<div class="horizontal"></div>
</div>
Just for kicks..just one table.
table {
margin: 1em auto;
border-collapse:collapse;
}
td {
background: blue;
padding: 20px;
}
tr:nth-child(4) td,
td:nth-child(3) {
background: yellow;
}
<table>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
Use CSS borders and border-collapse:collapse. Adjust the border width as necessary.
<!DOCTYPE html>
<html>
<head>
<style>
table.blue {background-color: #0000ff;border-collapse:collapse}
table.yellow {background-color: #ffff00;border-collapse:collapse}
.top-left {border-bottom: 12px solid #ffff00;border-right: 12px solid #ffff00;}
.top-right {border-bottom: 12px solid #ffff00;border-left: 12px solid #ffff00;}
.bottom-left {border-top: 12px solid #ffff00;border-right: 12px solid #ffff00;}
.bottom-right {border-top: 12px solid #ffff00;border-left: 12px solid #ffff00;}
</style>
<title>HTML Table</title>
</head>
<body>
<table class="yellow" border="10" width="320px">
<tr>
<td>
<table class="blue" border="1" width="100%">
<tr>
<td height="40" class="top-left">blue</td>
<td class="top-right">blue</td>
</tr>
<tr>
<td height="40" class="bottom-left">blue</td>
<td class="bottom-right">blue</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</body>
</html>
You can set the border for every side seperatly per cell:
<!DOCTYPE html>
<html>
<head>
<style>
table.blue {background-color: blue;border-collapse: collapse;}
.sweden_cell1 { border-right: 5px solid #ffff00;border-bottom: 5px solid #ffff00;}
.sweden_cell2 { border-left: 5px solid #ffff00;border-bottom: 5px solid #ffff00;}
.sweden_cell3 { border-right: 5px solid #ffff00;border-top: 5px solid #ffff00;}
.sweden_cell4 { border-left: 5px solid #ffff00;border-top: 5px solid #ffff00;}
</style>
<title>HTML Table</title>
</head>
<body>
<table class="yellow" border="10" width="320px">
<tr>
<td>
<table class="blue" border="1" width="100%">
<tr>
<td class="sweden_cell1" height="40">blue</td>
<td class="sweden_cell2">blue</td>
</tr>
<tr>
<td class="sweden_cell3" height="40">blue</td>
<td class="sweden_cell4">blue</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Also as you can see you need the border-collapse: collapse; property to make the borders have no space between them
Futhermore if you wish to make the yellow part wider, just increase the pixel with of the border in the css (which is as 5px atm)
I think you can't make that space between columns and rows. You could make table with 3 rows and columns, paint cells in yellow and blue. But here you can find more interesting idea of swedish flag with just one div. http://talgautb.github.io/vexillum/demo/
You need to use border-collapse and add the borders to the cells of the table.
<!DOCTYPE html>
<html>
<head>
<style>
table.blue {
background-color: #0000ff;
border-collapse: collapse;
width:320px;
}
.border-right { border-right: 30px solid #ffff00;}
.border-bottom { border-bottom: 30px solid #ffff00;}
</style>
<title>HTML Table</title>
</head>
<body>
<table>
<tr>
<td>
<table class="blue" border="1">
<tr class="border-bottom">
<td height="60" width="30%" class="border-right"></td>
<td width="70%"></td>
</tr>
<tr>
<td height="60" width="30%" class="border-right"></td>
<td width="70%"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</body>
</html>
With the following adjustments to your CSS it kind-of looks like the swedish flag.
I used various different CSS selectors to make this happen, altho I doubt that it'll be easy to understand I'll try to explain
I removed a table from your HTML, it was redundant as the swedish flag yellow areas can be created through the borders just one table.
What I did was gave every td element in your table a border: 10px solid #ffff00 which creates borders around every td element.
then after that I used some more complex selectors to target specific td elements and remove borders where they weren't required.
So the first tr element in the table can be selected with :first-child (just like any other first child to a parent can be selected like this). but then we also want the first td from that which makes for the total selector:
table.blue tr:first-child td:first-child { ... }
as you can see below the CSS resets the border-top and border-left properties as this is the top-left td so the top and left part don't need the yellow border.
I simply followed the same principle with the rest of the selectors, targetting specific td elements and resetting the borders they did not need.
After that I also added some properties to reset the spacing between the borders to 0 with cellspacing="0" cellpadding="0" - these two properties aren't consistently available in CSS so they have to be put in the HTML.
I also removed the redundant border property on the table because we can set the border through CSS which allows us to be more flexible as we don't have to do styling through editing HTML.
for further reading on first-child and last-child CSS selectors:
:first-child
:nth-child(n)
Hope this helps you abit.
Good luck!
<!DOCTYPE html>
<html>
<head>
<style>
table.blue {background-color: #0000ff;}
table.blue td {border: 10px solid #ffff00;}
table.blue tr:first-child td:first-child { border-top: none; border-left: none; }
table.blue tr:first-child td:nth-child(2) { border-top: none; border-right: none; }
table.blue tr:nth-child(2) td:first-child { border-bottom: none; border-left: none; }
table.blue tr:nth-child(2) td:nth-child(2) { border-bottom: none; border-right: none; }
</style>
<title>HTML Table</title>
</head>
<body>
<table class="blue" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td height="40">blue</td>
<td>blue</td>
</tr>
<tr>
<td height="40">blue</td>
<td>blue</td>
</tr>
</table>
</body>
</html>
</body>
</html>
Here's a way to do it by creating it without tables, and instead layering 2 objects on each other.
What I like about doing it this way like other answers here show as opposed to tables is it shows you a bunch of different powers of css. z-index is a layering style option (-1 for #rectangle places it behind the div). You can play around with the width, height, top, and left values for each to see how they change the placement of the shapes.
#plus-sign {
background:yellow;
width:20px;
height:100px;
position:relative;
margin-left:33px;
}
#plus-sign:before {
background:yellow;
content:"";
width:200px;
height:20px;
position:absolute;
top:40px;
left:-33px;
}
#rectangle {
width:200px;
height:100px;
background-color:blue;
position: absolute;
z-index: -1;
left:-33px;
}
<div id="plus-sign"><span id="rectangle"></span></div>
Nice n' easy Lemon squeezie.
Adjust the border widths evenly for a skinnier or fatter yellow line.
You can also change the colors as your see fit using hexadecimal coloring to more closely match the true Swedish flag colors by replacing "yellow" with a hashtag and then whatever color # in hexadecimal for the true colors. The same can be done with the blue. Hope it helps! ;)
#swedeFlag{
width: 320px;
height: 200px;
border:1px solid black;
}
#swedeFlag .left{
background-color: blue;
height: 40px;
border-bottom: solid yellow 10px;
border-right: solid yellow 10px;
}
#swedeFlag .right{
background-color: blue;
height: 40px;
border-bottom: solid yellow 10px;
border-left: solid yellow 10px;
width: 200px;
}
#swedeFlag .bLeft{
background-color: blue;
height: 40px;
border-top: solid yellow 10px;
border-right: solid yellow 10px;
}
#swedeFlag .bRight{
background-color: blue;
height: 40px;
border-top: solid yellow 10px;
border-left: solid yellow 10px;
width: 200px;
}
<table id="swedeFlag" border="2" width="320px" cellspacing="0">
<tr>
<td class="left">blue</td>
<td class="right">blue</td>
</tr>
<tr>
<td class="bLeft">blue</td>
<td class="bRight">blue</td>
</tr>
</table>
<!--http://www.w3schools.com/css/css_border.asp -->

Resources