Make image all the same size - css

.table-img {
height: 50px;
display: block;
margin-left: auto;
margin-right: auto;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<table class="table center-aligned-table table-striped" id="dataTable" cellspacing="0" width="100%">
<thead>
<tr>
<th class="text-center text-primary">Image</th>
<th class="text-center text-primary">Name</th>
<th class="text-center text-primary">Username</th>
<th class="text-center text-primary">Permissions</th>
<th class="text-center text-primary">Status</th>
</tr>
</thead>
<tbody>
<tr class="text-center">
<td><img class="img-responsive img-rounded table-img" src="data:image/png;base64, null"></td>
<td>John Smith</td>
<td>admin</td>
<td>Administrator</td>
<td><label class="badge badge-success">Online</label></td>
</tr>
<tr class="text-center">
<td><img class="img-responsive img-rounded table-img" src="https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/68dd54ca-60cf-4ef7-898b-26d7cbe48ec7/10-dithering-opt.jpg" ></td>
<td>asdajdaslf</td>
<td>admin50</td>
<td>Administrator</td>
<td><label class="badge badge-danger">Offline</label></td>
</tr>
</tbody>
</table>
I'm trying to make my images look like this: http://designcollection.in/codecanyon/table-record/table-design-7.html?ref=designcollection
But so far I've managed to make the images all the same size. The user can input any image size I just want to make the image all the same size and rounded.
https://i.gyazo.com/4eb460be09fea8e0eef939fb9ae4bb0f.png
I'm using bootstrap and I tried this css:
.table-img {
height: 50px;
display: block;
margin-left: auto;
margin-right: auto;
}

Your property height: 50px; is being override by bootstrap's .img-responsive property, giving height: auto;. Either use a higher specificity in your code, or simply load your styles after the bootstrap css, giving the same rules.
To prove my case, change the property to height: 50px !important; and see that is does work. I'm not saying it's a good practice to use !important, it's just a quick way to show you that it's a specificity issue...

Please try snippet code:
.table .table-img {
width: 50px;
height: 50px;
display: block;
margin-left: auto;
margin-right: auto;
border-radius: 100%;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<table class="table center-aligned-table table-striped" id="dataTable" cellspacing="0" width="100%">
<thead>
<tr>
<th class="text-center text-primary">Image</th>
<th class="text-center text-primary">Name</th>
<th class="text-center text-primary">Username</th>
<th class="text-center text-primary">Permissions</th>
<th class="text-center text-primary">Status</th>
</tr>
</thead>
<tbody>
<tr class="text-center">
<td><img class="img-responsive img-rounded table-img" src="data:image/png;base64, null"></td>
<td>John Smith</td>
<td>admin</td>
<td>Administrator</td>
<td><label class="badge badge-success">Online</label></td>
</tr>
<tr class="text-center">
<td><img class="img-responsive img-rounded table-img" src="https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/68dd54ca-60cf-4ef7-898b-26d7cbe48ec7/10-dithering-opt.jpg" ></td>
<td>asdajdaslf</td>
<td>admin50</td>
<td>Administrator</td>
<td><label class="badge badge-danger">Offline</label></td>
</tr>
</tbody>
</table>

If maintaining image aspect ratio is important, consider wrapping the img element in a containing element as demonstrated in the embedded code snippet below.
Code Snippet Demonstration:
.table-img {
height: 50px;
width: 50px;
overflow: hidden;
display: block;
margin-left: auto;
margin-right: auto;
border-radius: 100%;
}
.table-img img {
max-height: 50px;
max-width: none;
min-width: 100%;
min-height: 50px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<table class="table center-aligned-table table-striped" id="dataTable" cellspacing="0" width="100%">
<thead>
<tr>
<th class="text-center text-primary">Image</th>
<th class="text-center text-primary">Name</th>
<th class="text-center text-primary">Username</th>
<th class="text-center text-primary">Permissions</th>
<th class="text-center text-primary">Status</th>
</tr>
</thead>
<tbody>
<tr class="text-center">
<td><img class="img-responsive img-rounded table-img" src="data:image/png;base64, null"></td>
<td>John Smith</td>
<td>admin</td>
<td>Administrator</td>
<td><label class="badge badge-success">Online</label></td>
</tr>
<tr class="text-center">
<td>
<div class="table-img"> <!-- new containing element to wrap img -->
<img class="img-responsive img-rounded" src="https://cloud.netlifyusercontent.com/assets/344dbf88-fdf9-42bb-adb4-46f01eedd629/68dd54ca-60cf-4ef7-898b-26d7cbe48ec7/10-dithering-opt.jpg">
</div>
</td>
<td>asdajdaslf</td>
<td>admin50</td>
<td>Administrator</td>
<td><label class="badge badge-danger">Offline</label></td>
</tr>
</tbody>
</table>
The obvious drawback to this being that landscape orientated images will be better supported than portrait orientated images, but depending on your situation, that may be negligible.

Just add !important to your css:
CSS:
.table-img {
height: 50px !important;
display: block;
margin-left: auto;
margin-right: auto;
}
Because this value is overiden by img-responsive class...

add border-radius: 50%; to make it circular
.table-img {
height: 50px;
display: block;
margin-left: auto;
margin-right: auto;
border-radius: 50%;
}
or
.img-rounded {
border-radius: 50%!important;
height: 30px;
}

style sheet class definition
.table-img {
height: 50px;
width : 50px;
border-radius: 50%;
display: block;
margin-left: auto;
margin-right: auto;
}
then call in html file like this
<table>
<tr><td>
<img class='table-img' src='yourimage.jpg' />
</td></tr>
</table>

Related

moving arrowUp/Down to the right

I would like to move the green and red arrow to the left of the numerical value.
I tried:
.arrowDown {
position: relative;
padding-right: 15px;
}
It doesn't do what I want, the arrows don't move to the right.
.arrowUp,
.arrowDown {
position: relative;
padding-right: 15px;
}
.arrowUp:before,
.arrowDown:before {
content: "";
border-style: solid;
border-width: 5px 5px;
position: absolute;
left: 8.5%;
transform: translate(-50%, -50%);
}
.arrowUp:before {
border-color: transparent transparent #0dff00 transparent;
top: 37%;
}
.arrowDown:before {
border-color: #ff0000 transparent transparent transparent;
top: 60%;
}
<!DOCTYPE html>
<html>
<head>
<title>HTML CSS JS</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<div class="home-content container ">
<h1 class="text-center pt-5 pb-3">Indices boursiers</h1>
<div class="row pt-3 container">
<table class="table table-bordered">
<thead class="thead-light">
<tr class="text-center">
<th scope="col">Indice</th>
<th scope="col">Place</th>
<th scope="col">Cours</th>
<th scope="col">Variation</th>
<th scope="col">Date et heure</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" class="text-center">AED / EUR</th>
<td>Euronext Amsterdam</td>
<td class="text-end">1 134,65</td>
<td class="text-end">
<div class="arrowUp"></div>0,31 %</td>
<td class="text-center">08/11 - 10:04</td>
</tr>
<tr>
<th scope="row" class="text-center">ARS / EUR</th>
<td>Euronext Amsterdam</td>
<td class="text-end">1 134,65 </td>
<td class="text-end">
<div class="arrowDown"></div>-0.15 %</td>
<td class="text-center">08/11 - 10:04</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
It's because there is also a left property set on .arrowUp:before, .arrowDown:before try altering the left value and your arrow moves! Or remove the left property and replace it with right.
Like these values for example:
.arrowUp,
.arrowDown {
position: relative;
padding-right: 15px;
}
.arrowUp:before,
.arrowDown:before {
content: "";
border-style: solid;
border-width: 5px 5px;
position: absolute;
/* Changed this */
right: 50px;
top: 10px;
transform: translate(-50%, -50%);
}
.arrowUp:before {
border-color: transparent transparent #0dff00 transparent;
}
.arrowDown:before {
border-color: #ff0000 transparent transparent transparent;
/* Added this */
top: 15px;
}
<!DOCTYPE html>
<html>
<head>
<title>HTML CSS JS</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<div class="home-content container ">
<h1 class="text-center pt-5 pb-3">Indices boursiers</h1>
<div class="row pt-3 container">
<table class="table table-bordered">
<thead class="thead-light">
<tr class="text-center">
<th scope="col">Indice</th>
<th scope="col">Place</th>
<th scope="col">Cours</th>
<th scope="col">Variation</th>
<th scope="col">Date et heure</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" class="text-center">AED / EUR</th>
<td>Euronext Amsterdam</td>
<td class="text-end">1 134,65</td>
<td class="text-end">
<div class="arrowUp"></div>0,31 %</td>
<td class="text-center">08/11 - 10:04</td>
</tr>
<tr>
<th scope="row" class="text-center">ARS / EUR</th>
<td>Euronext Amsterdam</td>
<td class="text-end">1 134,65 </td>
<td class="text-end">
<div class="arrowDown"></div>-0.15 %</td>
<td class="text-center">08/11 - 10:04</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>

CSS DIV width based on text length with position absolute relative to a TABLE cell

Brief introduction:
with my attempts I have reached an acceptable result
to a specific table cell I set inline the (in the screenshots below it is the third last TH)
<th style="position:relative;">Column Name</th>
then inside the cell I have positioned my DIV
<th style="position:relative;"><div id="myDiv" style="position:relative;">Line 1 - medium length<br>Line2 - John</div></th>
EDIT: as requested I post the significant code
the DIV CSS
#provDiv{ /** the DIV CSS */
position: absolute;
top: 0;
right: 0;
width: auto;
background: greenyellow;
text-align: right;
}
the involved cell,
<th data-dbrow="device" scope="col"
style="position:relative; width: 10%">
<div id="provDiv">Line 1 - medium length<br>Line 2 - John</div>
</th>
What it happen is that (I'd say "obviously") the DIV long text will wrap, because the DIV will have as maximum width -> the table column's width, this using width: auto;
while if I set width: 300px the DIV width is really 300px
with fixed width, I have the DIV larger than the column width,
but then the div is ALWAYS large 300px, despite the content,
so if DIV innerText is just 5 chars like "hello", I have a laaaaarge DIV quite awful to see.
Well the question is:
how to have the DIV WIDTH that adapts to the text line length, without using a fixed width?
please note that I must use bootstrap 5
if it can help in this case, I'm available to use flexbox, but I haven't studied it yet
These are my tests
current result with auto and two text lines long text
worse result with fixed width and short text
1th wanted result
2nd wanted result
Check the classes = parent, myDiv. This is a mix of using table and flexbox layout
#customers {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#customers td, #customers th {
border: 1px solid #ddd;
height: 35px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
text-align: left;
background-color: #04AA6D;
color: white;
}
/* Check the styles below*/
.parent {
display: flex;
align-items: center;
}
.myDiv {
background-color: red;
height: 100%;
width: fit-content;
padding: 0 10px;
margin-left: auto;
display: flex;
align-items: center;
}
<table id="customers">
<thead>
<tr>
<th class="parent">
Company
<div class="myDiv">Hello World</div>
</th>
<th>Contact</th>
<th>Country</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Berglunds snabbköp</td>
<td>Christina Berglund</td>
<td>Sweden</td>
</tr>
</tbody>
</table>
And you can hide large text and show dots instead if the width of myDiv is more than 300px:
.myDiv {
text-overflow: ellipsis;
overflow: hidden;
max-width: 300px;
white-space: nowrap;
}
EDIT: Solution for your code
Check:
#provDiv{
position: absolute;
top: 0;
right: 0;
width: fit-content;
padding: 0 5px;
background: greenyellow;
text-align: right;
/*ADDED*/
text-overflow: ellipsis;
overflow: hidden;
max-width: 300px;
white-space: nowrap;
}
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" type="image/png" href="/favicon-32x32.png">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<style>
#provDiv{
position: absolute;
top: 0;
right: 0;
width: fit-content;
padding: 0 5px;
background: greenyellow;
text-align: right;
text-overflow: ellipsis;
overflow: hidden;
max-width: 300px;
white-space: nowrap;
}
</style>
<title>Title</title>
</head>
<body>
<div class="container-fluid">
<div class="d-flex flex-wrap">
<div class="col-xl-6 col-sm-12">
<div class="d-flex justify-content-start">
<h1 class="p-1">Calls</h1>
<p id="provincie"></p>
</div>
</div>
<div class="col-xl-6 col-sm-12">
<div class="d-flex flex-wrap justify-content-end">
<div>
<button class="btn btn-primary m-3" id="AggiungiRiga" type="submit" value="Submit" >+ Riga</button>
</div>
<div>
<button class="btn btn-danger m-3" id="EliminaRiga" type="submit" value="Submit" >- Riga</button>
</div>
<div>
<button class="btn btn-success m-3" id="SalvaRiga" type="submit" value="Submit" >Salva</button>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table style="min-width:1000px;" class="table table-striped table-hover table-bordered text-center" id="tabella">
<thead>
<tr>
<th data-dbrow="riga" scope="col" style="width: 5%">#</th>
<th data-dbrow="id" scope="col" style="width: 5%">ID</th>
<th data-dbrow="nome" scope="col" style="width: 30%">Nome</th>
<th data-dbrow="tel" scope="col" style="width: 11%">Telefono</th>
<th data-dbrow="mail" scope="col" style="width: 29%">Email</th>
<th data-dbrow="device" scope="col" style="position:relative; width: 10%">
<select id="select1" class="form-select form-select-sm">
<option value="$" selected disabled>- Text 1 -</option>
<option value="val1">Text 2</option>
<option value="val2">Text 3</option>
<option value="val2">Text 4</option>
</select>
<div id="provDiv">Line 1 - medium length<br>Line 2 - John</div>
</th>
<th data-dbrow="iscli" scope="col" style="width: 5%">È Cli</th>
<th data-dbrow="prov" scope="col" class="cellaProv" style="width: 5%">Prov</th>
</tr>
</thead>
<tbody id="table1bd">
<tr>
<th>some text</th>
<td>some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
<td>some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
</tr>
<tr>
<th>some text</th>
<td>some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
<td>some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
</tr>
<tr>
<th>some text</th>
<td>some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
<td>some text</td>
<td contenteditable="true">some text</td>
<td contenteditable="true">some text</td>
</tr>
</tbody>
</table>
</div>
</div>
<pre></pre>
<!-- Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
</body>
</html>

Bootstrap 4 table tbody spinner wrong position on chrome and Internet explorer

I want to create a dynamically spinner in a table tbody bootstrap 4.
I have tried this way:
HTML
<div class="container mt-2">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div>
<span class="table-title">table</span>
</div>
<hr>
<div class="table-responsive text-nowrap">
<table id="contact-list" class="table table-striped table-bordered table-sm bstable">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Click</th>
</tr>
</thead>
<tbody>
<td>a</td>
<td>b</td>
<td>c</td>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
CSS
.bstable tbody {
position: relative;
}
.bstable tbody .overlay-spinner {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
}
JS
var s = '<div class="spinner-grow text-primary spinner-grow-sm mt-2"><span class="sr-only">Loading...</span></div>;
$( '.bstable' ).find( 'tbody' ).append( '<div class="overlay-spinner text-center">' + s + '</div>' );
With firefox the spinner is correctly shown in tbody, while with the other browsers (chrome, edge, explorer) the spinner is shown above the table.
See my JSFiddle
Unfortunately I can not understand where the problem is.
Can you help me to solve my problem?
Thanks
please add the spinner to the div around your table and not to the table body in JS. Then adjust it with top 50% and left 50% and reduce this alignment by the height and width of the spinner to adjust it right in the middle. after that i removed the bottom margin from the tables parent div to get the spinner exactly in the middle of the table.
var s = '<div class="spinner-grow text-primary spinner-grow-sm mt-2"><span class="sr-only">Loading...</span></div>';
$('.table-responsive').append('<div class="overlay-spinner text-center">' + s + '</div>');
table.table {
margin-bottom: 0;
}
.table-responsive {
position: relative;
margin-bottom: 1rem;
}
.overlay-spinner {
position: absolute;
top: 50%;
left: 50%;
margin-top: -1rem;
margin-left: -1rem;
z-index: 10;
background-color: rgba(0, 0, 0, 0);
/*dim the background*/
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container mt-2">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div>
<span class="table-title">TABLE</span>
</div>
<hr>
<div class="table-responsive text-nowrap">
<table id="contact-list" class="table table-striped table-bordered table-sm bstable">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Click</th>
</tr>
</thead>
<tbody>
<td>a</td>
<td>b</td>
<td>c</td>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
Find below solution.
I've done it with 'tr' tag for wrapper element of the loader.
Loader stays vertically in center dispute of rows added.
But you need to explicitly set colspan when ever new column is added or removed, to keep the loader horizontally center.
Replace 'loading' text with your loader animation.
table {
position: relative;
}
tbody {
background-color: yellow;
position: relative;
}
.loading {
position: absolute;
background: antiquewhite;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
height: fit-content;
width: fit-content;
}
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Click</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr class="loading">
<td colspan="3">
loading
</td>
</tr>
</tbody>
</table>

How to set table height to height of container with vertical scroll?

http://jsfiddle.net/awu1tzoj/
Is there a trick I'm missing to this? I want the table to also be limited to the height of the .panel-body.
html, body {
height: 100%;
}
.panel-body {
height: 100px;
}
table {
width: 100%;
height: 100%;
overflow-y: scroll;
}
You need to add overflow: auto to the .panel-body class like so:
html,
body {
height: 100%;
}
.panel-body {
height: 100px;
overflow: auto;
}
table {
width: 100%;
}
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
<table>
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
</div>
</div>
JSFiddle: http://jsfiddle.net/awu1tzoj/2/

Can't display SVG charts in Internet Explorer 8

I made a servlet that runs and renders a BIRT report, using ReportEngine API.
The only problem is that SVG images (charts) are not shown in Internet Explorer 8 or 7. While running the official BirtViewer webapp they are shown under IE8 too.
I peeked into BirtViewer resulting HTML and noticed this meta tag:
<!-- Mimics Internet Explorer 7, it just works on IE8. -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
So I tried adding it by hand in my own resulting HTML, but with no changes. I also tried adding it through the servlet (which is the regular way) writing:
response.setHeader("X-UA-Compatible", "IE=EmulateIE7");
immediately after the setContentType instruction, but it not even outputted the meta tag...
EDIT: here is resulting HTML from BirtViewer official webapp (I cleaned up the parts with no interest here):
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>BIRT Report Viewer</title>
<base href="http://192.168.81.92:5080/BirtViewer/webcontent/birt">
<!-- Mimics Internet Explorer 7, it just works on IE8. -->
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible">
<meta content="text/html; CHARSET=utf-8" http-equiv="Content-Type">
<!-- a lot of scripts -->
</head>
<body class="BirtViewer_Body" style="overflow: hidden; direction: ltr"
leftmargin="0px" scroll="no" onload="javascript:init( );">
<!-- Header section -->
<table id="layout" cellspacing="0" cellpadding="0"
style="width: 100%; height: 100%">
<tbody>
<tr valign="top">
<td id="reportdialog" style="width: 0%; vertical-align: top">
<div id="exceptionDialog" class="dialogBorder"
style="display: none; position: absolute; z-index: 220; top: 0px; left: 0px;">
<iframe id="exceptionDialogiframe" frameborder="0" scrolling="no"
src="birt/pages/common/blank.html"
style="z-index: -1; display: none; left: 0px; top: 0px; background-color: #ff0000; opacity: .0; filter: alpha(opacity = 0); position: absolute;"
name="exceptionDialogiframe">
<html>
<head></head>
<body></body>
</html>
</iframe>
<div id="exceptionDialogdialogTitleBar"
class="dialogTitleBar dTitleBar">
<div class="dTitleTextContainer">
<table style="width: 100%; height: 100%;">
<tbody>
<tr>
<td class="dialogTitleText dTitleText">Exception</td>
</tr>
</tbody>
</table>
</div>
<div class="dialogCloseBtnContainer dCloseBtnContainer">
<table style="width: 100%; height: 100%; border-collapse: collapse">
<tbody>
<tr>
<td><label class="birtviewer_hidden_label"
for="exceptionDialogdialogCloseBtn"> Close </label>
<div id="exceptionDialogdialogCloseBtn"
class="dialogCloseBtn dCloseBtn"></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- overflow is set as workaround for Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=167801 -->
<div class="dialogBackground" style="overflow: auto;">
<div class="dBackground">
<div id="exceptionDialogdialogContentContainer"
class="dialogContentContainer">
<table class="birtviewer_dialog_body" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td class="birtviewer_exception_dialog">
<table cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td valign="top"><img src="birt/images/Error.gif"></td>
<td>
<table class="birtviewer_exception_dialog_container"
cellspacing="2" cellpadding="4">
<tbody>
<tr>
<td>
<div id="faultStringContainer"
class="birtviewer_exception_dialog_message"
style="width: 520px; overflow: auto;"><b> <span
id="faultstring"></span> <b> </b> </b></div>
<b> <b> </b> </b></td>
</tr>
<tr>
<td>
<div id="showTraceLabel"
class="birtviewer_exception_dialog_label" tabindex="0">
Show Exception Stack Trace</div>
<div id="hideTraceLabel"
class="birtviewer_exception_dialog_label"
style="display: none" tabindex="0">Hide Exception
Stack Trace</div>
</td>
</tr>
<tr>
<td>
<div id="exceptionTraceContainer"
style="display: none; width: 520px;">
<table width="100%">
<tbody>
<tr>
<td>Stack Trace: <br>
</td>
</tr>
<tr>
<td>
<div class="birtviewer_exception_dialog_detail"
style="width: 510px;"><span id="faultdetail"></span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div class="dialogBtnBarContainer">
<div>
<div class="dBtnBarDividerTop"></div>
<div class="dBtnBarDividerBottom"></div>
</div>
<div class="dialogBtnBar">
<div id="exceptionDialogdialogCustomButtonContainer"
class="dialogBtnBarButtonContainer">
<div id="exceptionDialogokButton" class="dialogBtnBarButtonEnabled">
<div id="exceptionDialogokButtonLeft"
class="dialogBtnBarButtonLeftBackgroundEnabled"></div>
<div id="exceptionDialogokButtonRight"
class="dialogBtnBarButtonRightBackgroundEnabled"></div>
<input class="dialogBtnBarButtonText dialogBtnBarButtonEnabled"
type="button" title="OK" value="OK"></div>
<div class="dialogBtnBarDivider"></div>
<div id="exceptionDialogcancelButton">
<div class="dialogBtnBarButtonLeftBackgroundEnabled"></div>
<div class="dialogBtnBarButtonRightBackgroundEnabled"></div>
<input class="dialogBtnBarButtonText dialogBtnBarButtonEnabled"
type="button" title="Cancel" value="Cancel"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="parameterDialog" class="dialogBorder"
style="position: absolute; z-index: 201; top: 173px; left: 325.5px; width: 520px; display: none;">
<iframe id="parameterDialogiframe" frameborder="0" scrolling="no"
src="birt/pages/common/blank.html"
style="z-index: -1; display: none; left: 0px; top: 0px; background-color: rgb(255, 0, 0); opacity: 0; position: absolute; width: 522px; height: 429px;"
name="parameterDialogiframe">
<html>
<head></head>
<body></body>
</html>
</iframe>
<div id="parameterDialogdialogTitleBar"
class="dialogTitleBar dTitleBar">
<div class="dTitleTextContainer">
<table style="width: 100%; height: 100%;">
<tbody>
<tr>
<td class="dialogTitleText dTitleText">Parameter</td>
</tr>
</tbody>
</table>
</div>
<div class="dialogCloseBtnContainer dCloseBtnContainer">
<table style="width: 100%; height: 100%; border-collapse: collapse">
<tbody>
<tr>
<td><label class="birtviewer_hidden_label"
for="parameterDialogdialogCloseBtn"> Close </label>
<div id="parameterDialogdialogCloseBtn"
class="dialogCloseBtn dCloseBtn"></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- overflow is set as workaround for Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=167801 -->
<div class="dialogBackground" style="overflow: auto;">
<div class="dBackground">
<div id="parameterDialogdialogContentContainer"
class="dialogContentContainer" style="width: 500px;">
<div class="birtviewer_parameter_dialog">
<table id="parameter_table" class="birtviewer_dialog_body"
cellspacing="2" cellpadding="2">
<tbody>
<tr valign="top">
<td>
<table style="font-size: 8pt">
<tbody>
<tr height="5px">
<td></td>
</tr>
<tr>
<td colspan="2">Parameters marked with <font color="red">*</font>
are required.</td>
</tr>
<tr>
<td nowrap=""><img title=""
alt="Numero di anni da confrontare"
src="birt/images/parameter.gif"></td>
<td nowrap=""><font title=""> <label
for="Years_selection">Numero di anni da confrontare:</label> </font>
<font color="red"> <label for="Years_selection">*</label>
</font></td>
</tr>
<tr>
<td nowrap=""></td>
<td nowrap="" width="100%"><input id="control_type"
type="HIDDEN" value="select"> <input id="data_type"
type="HIDDEN" value="6"> <input id="Years_value"
type="HIDDEN" name="Years"> <select
id="Years_selection"
class="birtviewer_parameter_dialog_Select"
aria-required="true" birtparametertype="combobox" title="2">
<option title="2" value="2">2</option>
<option title="3" value="3">3</option>
<option title="4" value="4">4</option>
</select> <input id="isRequired" type="HIDDEN" value="true"></td>
</tr>
<tr>
<td nowrap=""><img title="" alt="Codice dell'agente"
src="birt/images/parameter.gif"></td>
<td nowrap=""><font title=""> <label for="Agent">Codice
dell'agente:</label> </font> <font color="red"> <label for="Agent">*</label>
</font></td>
</tr>
<tr>
<td nowrap=""></td>
<td nowrap="" width="100%"><input id="control_type"
type="HIDDEN" value="text"> <input id="data_type"
type="HIDDEN" value="1"> <input id="Agent"
class="BirtViewer_parameter_dialog_Input" type="TEXT"
aria-required="true" value="" title="" name="Agent"> <input
id="Agent_value" type="HIDDEN" value=""> <input
id="Agent_displayText" type="HIDDEN" value=""> <input
id="isRequired" type="HIDDEN" value="true"></td>
</tr>
<tr height="5px">
<td></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<div id="birt_hint"
style="font-size: 12px; color: #000000; display: none; position: absolute; z-index: 300; background-color: #F7F7F7; layer-background-color: #0099FF; border: 1px #000000 solid; filter: Alpha(style = 0, opacity = 80, finishOpacity = 100);">
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="dialogBtnBarContainer">
<div>
<div class="dBtnBarDividerTop"></div>
<div class="dBtnBarDividerBottom"></div>
</div>
<div class="dialogBtnBar">
<div id="parameterDialogdialogCustomButtonContainer"
class="dialogBtnBarButtonContainer">
<div id="parameterDialogokButton" class="dialogBtnBarButtonEnabled">
<div id="parameterDialogokButtonLeft"
class="dialogBtnBarButtonLeftBackgroundEnabled"></div>
<div id="parameterDialogokButtonRight"
class="dialogBtnBarButtonRightBackgroundEnabled"></div>
<input class="dialogBtnBarButtonText dialogBtnBarButtonEnabled"
type="button" title="OK" value="OK"></div>
<div class="dialogBtnBarDivider"></div>
<div id="parameterDialogcancelButton">
<div class="dialogBtnBarButtonLeftBackgroundEnabled"></div>
<div class="dialogBtnBarButtonRightBackgroundEnabled"></div>
<input class="dialogBtnBarButtonText dialogBtnBarButtonEnabled"
type="button" title="Cancel" value="Cancel"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
<tr valign="top">
<td id="documentView" style="direction: ltr;">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="vertical-align: top;">
<div id="progressBar"
style="position: absolute; z-index: 310; top: 346px; left: 461.5px; display: none;">
<table class="birtviewer_progressbar" cellspacing="10px"
width="250px">
<tbody>
<tr>
<td align="center"><b> Processing, please wait ... </b></td>
</tr>
<tr>
<td align="center"><img alt="Progress Bar Image"
src="birt/images/Loading.gif"></td>
</tr>
<tr>
<td align="center">
<div id="cancelTaskButton" style="display: block;">
<table width="100%">
<tbody>
<tr>
<td align="center"><input
class="birtviewer_progressbar_button" type="BUTTON"
title="Cancel" value="Cancel"></td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<input id="taskid" type="HIDDEN" value="">
</tbody>
</table>
</div>
<div id="display0"
style="display: none; width: 250px; position: relative; overflow: auto">
</div>
</td>
<td style="vertical-align: top;">
<div id="Document" class="birtviewer_document_fragment"
style="width: 1167px; height: 535px;">
<div>
<div class="style_0">
<table cellpadding="0"
style="empty-cells: show; width: 8in; overflow: hidden; table-layout: fixed;"
rule="none">
<colgroup>
<col>
</colgroup>
<tbody>
<tr>
<td></td>
</tr>
<tr>
<td valign="top">
<div id="AUTOGENBOOKMARK_1" class="style_4"
style="text-align: center;">Analisi per modello</div>
<table id="__bookmark_2" class="style_5"
style="border-collapse: collapse; empty-cells: show; width: 100%; overflow: hidden; table-layout: fixed;">
<colgroup>
<col style="width: 20%;">
<col style="width: 14%;">
<col style="width: 14%;">
<col style="width: 15%;">
<col style="width: 10%;">
</colgroup>
<tbody>
<tr class="style_6" align="center" valign="top">
<th class="style_7" style="overflow: hidden;">
<div id="AUTOGENBOOKMARK_2" style="text-align: left;">Modello</div>
</th>
<th class="style_7" style="overflow: hidden;">
<div>2010</div>
</th>
<th class="style_7" style="overflow: hidden;">
<div>2011</div>
</th>
<th class="style_7" style="overflow: hidden;" colspan="2">
<div>Diff. 2011-2010</div>
</th>
</tr>
<!-- various rows in the table..... -->
</tbody>
</table>
<div><embed id="__bookmark_3"
style="width: 558pt; height: 223.5pt; display: block;" alt=""
src="/BirtViewer/preview?__sessionId=20110523_145951_765&__imageid=custombf791612fc98d919920.svg"
type="image/svg+xml"
onresize="document.getElementById('__bookmark_3').reload()">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" height="298"
initialHeight="298.0" initialWidth="744.0"
onload="resizeSVG(evt)" onresize="resizeSVG(evt)" width="744">
<g id="outerG" style="fill:none;stroke:none"
transform="scale(1)">
</svg>
<!-- SVG image details..... -->
</embed></div>
</td>
</tr>
<tr>
<td>
<div>23/mag/2011 14.59</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div id="Mask"
style="position: absolute; top: 0px; left: 0px; width: 1173px; height: 537px; z-index: 200; background-color: rgb(0, 68, 255); opacity: 0; display: none;"></div>
<div
style="position: absolute; top: 0px; left: 0px; width: 1173px; height: 537px; z-index: 200; background-color: rgb(255, 0, 0); opacity: 0; display: none; cursor: move;"></div>
<iframe scrolling="no" src="birt/pages/common/blank.html"
style="position: absolute; top: 0px; left: 0px; width: 100%; height: 775px; z-index: 300; background-color: rgb(219, 228, 238); opacity: 0; display: none;"
marginheight="0px" marginwidth="0px">
<html>
<head></head>
<body></body>
</html>
</iframe>
</body>
</html>
Any suggestion? Many thanks!
The X-UA-Compatible meta tag that you've spotted is a red herring; it's not related to SVG. Neither IE8 or IE7 support SVG at all. Support for SVG was only added in IE9.
The meta tag you've seen tells IE8 (and IE9 for that matter) to fall back into IE7-compatibility mode. This is intended to be used by sites that were written for IE7, where updating the code to support IE8 or IE9 is too much work. I'd recommend avoiding using this meta tag if at all possible, because it's primary function is to switch off some of the functionality of your browser.
Back to SVG support.... While they don't support SVG, IE7 and IE8 do both support VML, which is also a vector graphics markup language, similar to SVG, but specific to IE.
Some Javascript libraries attempt to emulate SVG using VML, or to use VML as a fall-back instead of rendering SVG. My favourite is Raphael.
But Raphael is a library for drawing the graphics; since you already have the SVG, you may find a simple conversion library is more useful. Something like this, perhaps: http://code.google.com/p/svg2vml/ or this: http://code.google.com/p/svgweb/
The other approach would be to use Flash or other embedded object to render the SVG in IE.
My guess is that where you're seeing them successfully rendering SVG, they are using one of these libraries (or another similar one) to display the SVG graphics in IE7 and IE8.
You may consider using Ample SDK JavaScript library that can render SVG in IE6, 7 and 8.

Resources