1

I have a SVG file file.svg (converted from a pdf) embedded in a DOM object (td element). I want it to stretch to fill the container element. I tried

<td><object data="file.svg" type="image/svg+xml" max-width="100%"></object></td>

which displays it too big (probably the size of the default size of the file), and if I do

<td><object data="file.svg" type="image/svg+xml" width="100%"></object></td>

then it displays too small. What is the correct way to set the size so that it fills up the td element? Will it be easier if I use an external library like raphael.js, or is there a different way of embedding?

sawa
  • 165,429
  • 45
  • 277
  • 381

1 Answers1

1

A quick fast comment from me. Did you forget the equal sign?

width "100%"
max-width "100%"

Maybe try this, it works for me.

<img src="file.svg" style="width:100%;height:100%;" />
Daniel
  • 2,002
  • 5
  • 20
  • 32
  • Yea it happnes hehe, can you btw send me that file.svg file or link it here so i can test it real quick? :) – Daniel Dec 17 '12 at 23:56
  • or actually, can you make a zip file and put it on some site so i can get it with all the code plase :) – Daniel Dec 17 '12 at 23:57
  • Maybe also if you read this it will help: http://stackoverflow.com/questions/644896/how-do-i-scale-a-stubborn-svg-embedded-with-the-object-tag – Daniel Dec 18 '12 at 00:10